2011年7月7日星期四

Adding nil object to NSDictionary

NSDictionary and NSArray do not allow adding nil object to them.
But [NSNull null] can solve this problem in case you really want to have a "Null Object"


if(anObject!=nil)
{
[self setObject:anObject forKey:aKey];
return YES;
}
else
{
[self setObject:[NSNull null] forKey:aKey];
return NO;
}


reference: https://gist.github.com/307568

2011年4月8日星期五

Error launching remote program

Sometimes I will meet the error when running the app on the real device, aftering building it successfully.
The app would terminated right after clicking on it.

The console show such a error message: "Error launching remote program: failed to get the task for process"

Found a solution: for target setting, choose the right provisioning profile. for project setting, set the provisioning to "Don't Code re-sign"