Tag: iphone

Test if app did become active from a UILocalNotification

Is there a way to know if the application did become active from a local notification? I know there is a way to test if the application was launched from a local notification alert; but if it just was sitting out there the background, and received a notification? I need to run different code, when […]

Custom UISwitch & App Store approval

After doing some reading, I’ve found that you can customize the text and color on a UISwitch control. I’m curious if these methods will cause problems trying to get my app approved and included in the App Store. Sample code taken from iPhone Developer’s Cookbook Sample Code: // Custom font, color switchView = [[UICustomSwitch alloc] […]

UITableViewCell: How to prevent blue selection background w/o borking isSelected property?

I have a custom UITableViewCell subclass. I have set the contentView of my cell subclass to a custom UIView class in which i am overriding -drawRect: and doing all of the drawing there. Also, I am setting cell.contentView.opaque = NO in order to achieve transparency in certain areas of the cell (unfortunately, a backgroud image […]

360° panorama libraries for ios

Are there any libraries or classes out there to show a 360 degree panorama on the iPhone? I found this here: http://code.google.com/p/panoramagl/ but it’s not up to date and only for old versions of ios. I’m thankfull for any link that helps me to create a 360 degree panorama view on ios.

UITableView Core Data reordering

I know this question has been asked before, and I took a look at the answer to this question. However, I’m still confused as to how to implement reordering with a UITableView in a Core Data project. What I know is that I need to have a “displayOrder” attribute in my Entity to track the […]

Will my iPhone app take a performance hit if I use Objective-C for low level code?

When programming a CPU intensive or GPU intensive application on the iPhone or other portable hardware, you have to make wise algorithmic decisions to make your code fast. But even great algorithm choices can be slow if the language you’re using performs more poorly than another. Is there any hard data comparing Objective-C to C++, […]

How to scroll UITableView to specific position

How can I scroll the table’s cell to specific position ? I have a table which shows 3 rows (according to height). what I want is if I click on 1st row than according to table’s height the 1st row should scroll and get new position (center) and same for other rows. I tried contenOffset […]

What's the difference between NSNumber and NSInteger?

What’s the difference between NSNumber and NSInteger? Are there more primitives like these that I should know about? Is there one for floats?

Asynchronous request to the server from background thread

I’ve got the problem when I tried to do asynchronous requests to server from background thread. I’ve never got results of those requests. Simple example which shows the problem: @protocol AsyncImgRequestDelegate -(void) imageDownloadDidFinish:(UIImage*) img; @end @interface AsyncImgRequest : NSObject { NSMutableData* receivedData; id<AsyncImgRequestDelegate> delegate; } @property (nonatomic,retain) id<AsyncImgRequestDelegate> delegate; -(void) downloadImage:(NSString*) url ; @end @implementation […]

How can I convert my device token (NSData) into an NSString?

I am implementing push notifications. I’d like to save my APNS Token as a String. – (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken { NSString *tokenString = [NSString stringWithUTF8String:[newDeviceToken bytes]]; //[[NSString alloc]initWithData:newDeviceToken encoding:NSUTF8StringEncoding]; NSLog(@”%@”, tokenString); NSLog(@”%@”, newDeviceToken); } The first line of code prints null. the second prints the token. How can I get my newDeviceToken as an […]