Skip to content

Instantly share code, notes, and snippets.

View boboboa32's full-sized avatar

Bobo Shone boboboa32

  • Xiaoman
  • China
View GitHub Profile
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to People.h instead.
#import <CoreData/CoreData.h>
extern const struct PeopleAttributes {
__unsafe_unretained NSString *age;
__unsafe_unretained NSString *name;
} PeopleAttributes;
@boboboa32
boboboa32 / gist:3957243
Created October 26, 2012 06:34
validateEmail
- (BOOL)validateEmail:(id *)value error:(NSError **)error {
if (self.email && ![self.email isValidEmailAddress] && error) {
*error = [NSError errorWithDomain:@"MyErrorDomain" code:1];
return NO;
}
return YES;
}
local options =
{
to = { "1234567890", "9876543210" },
body = "I scored over 9000!!! Can you do better?"
}
native.showPopup("sms", options)
local options =
{
to = { "john.doe@somewhere.com", "jane.doe@somewhere.com" },
cc = { "john.smith@somewhere.com", "jane.smith@somewhere.com" },
subject = "My High Score",
isBodyHtml = true,
body = "<html><body>I scored over <b>9000</b>!!! Can you do better?</body></html>",
attachment =
{
{ baseDir=system.DocumentsDirectory, filename="Screenshot.png", type="image" },
void main()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *args = [[NSProcessInfo processInfo] arguments];
for (NSString *fileName in args) {
NSAutoreleasePool *loopPool = [[NSAutoreleasePool alloc] init];
NSError *error = nil;
NSString *fileContents = [[[NSString alloc] initWithContentsOfFile:fileName
encoding:NSUTF8StringEncoding error:&error] autorelease];
- (NSString *)fullName {
NSString *string = [[NSString alloc] initWithFormat:@"%@ %@", firstName,
lastName];
return string;
}
- (NSString *)fullName {
NSString *string = [[[NSString alloc] initWithFormat:@"%@ %@", firstName,
lastName] release];
return string;
}
- (NSString *)fullName {
NSString *string = [NSString stringWithFormat:@"%@ %@", firstName, lastName];
return string;
}
- (NSString *)fullName {
NSString *string = [[[NSString alloc] initWithFormat:@"%@ %@", firstName,
lastName] autorelease];
return string;
}
NSString *string;
string = [NSString stringWithFormat:@"Hello"];
NSLog(string);
NSString *string;
string = [[NSString alloc] initWithString:@"Hello"];
NSLog(string);
[string release];