Tag: cocoa touch

@class vs. #import

It is to my understanding that one should use a forward-class declaration in the event ClassA needs to include a ClassB header, and ClassB needs to include a ClassA header to avoid any circular inclusions. I also understand that an #import is a simple ifndef so that an include only happens once. My inquiry is […]

How does an underscore in front of a variable in a cocoa objective-c class work?

I’ve seen in a few iPhone examples that attributes have used an underscore _ in front of the variable. Does anyone know what this means? Or how it works? An interface file I’m using looks like: @interface MissionCell : UITableViewCell { Mission *_mission; UILabel *_missionName; } @property (nonatomic, retain) UILabel *missionName; – (Mission *)mission; I’m […]

Can I include the custom fonts to XIB?

In my iPhone App, I need custom fonts. I know how to include it through info.plist and programmatically, but can I have the fonts in the XIB file? Where can I set the custom fonts as shown in the image:

Page curl – Leaves Project – Interaction elements

Has anyone updated leaves page curl project to support Views with Interaction elements ? As of Leaves doesnot support that. or Is there any good alternate libraries – I have tried AFKFlipper.

How to convert a view-based iOS project an universal build?

I have a view-based iOS cocoa touch application built and is running on iPhone.Now I need to convert it as an universal application in order to run that on both iPhone and iPad.I dont know how to change a view-based as an universal build application. How can I convert it?

unused variable warning when variable is actually being used

I am given a warning in Xcode that a variable I am using, is not being used: – (void)timerTicked:(id)sender { [timerButton setTitle:[self timerIsActive] ? @”Stop timer” : @”Start Timer” forState:UIControlStateNormal]; if([self timerIsActive]) { NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:timeEntry.startDate]; double seconds = (int) interval % 60; double minutes = (int) interval / 60.0; double hours […]

How to create a UITableCell that has multiple subtitles

I came across this design image online and I am really puzzled on how could I make a UITableCell that has multiple subtitles and allows me to customised them in the way shown by the picture. My understanding is that one can only use 1 subtitle per cell. Is there a way to create a […]

Xcode: Pass NSString from one class to another problem

OK this should be an easy one but still im breaking my head here: In my root view controller I have a NSString called “entry” and is working perfectly. I NSLogged it and it works. I have another class called ┬┤ParseOperation┬┤ and in it i have a NSStringcalled “localEntry” and im trying to send to […]

UIApplication not launching to make phone call

I have this code: NSString *telURL = [NSString stringWithFormat:@”tel:1-%@”,((UIButton*) sender).titleLabel.text]; telURL = [telURL stringByReplacingOccurrencesOfString:@”\n” withString:@””]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:telURL]]; But it does not launch the dialer application to make a phone call. I’ve checked the string telURL and its contents are : “tel:[REDACTED]”, which to my understanding is what it needs to be. Any ideas? […]

toolbar previous and next button logic

I’m using the following code to move to the next field using the UITextField delegate and also I’m adding a toolbar to the keyboard with the previous, next and ok buttons. The code is working fine. Like you see the keyboard return button logic is pretty generic, using the UITextField tags, and that’s good because […]