cocoa-touch

Is there a way to print an clickable link to the console?

Is that generally possible? Is the console able to format a link so that it is clickable? i.e. a link that launches an application, or anything else when clicked? ...

How to check in an NSAssert of an variable is (null) ?

the console prints me (null) for an variable that should not be, so I want to put an assert there just for fun: NSAssert(myVar, @"myVar was (null)!"); what's the trick here? this (null) thing doesn't seem to be "nil", right? How can I check for it? I want to assume that the var is set properly and not nil, not null. ...

What's the point of NSAssert, actually?

I have to ask this, because: The only thing I recognize is, that if the assertion fails, the app crashes. Is that the reason why to use NSAssert? Or what else is the benefit of it? And is it right to put an NSAssert just above any assumption I make in code, like a function that should never receive a -1 as param but may a -0.9 or -1.1? ...

core data or sqlite or plist files

Hello, I have a situation where I need to store the data in local (iphone) and the same data will be in the web server to be accessed by other users (like sending messages) . For the web server part I am not worrying, I created all the tables and relations. but I am worrying about Iphone side data storage and sync both sides correctly....

Core Data: Returning properties depending on a value

Hi! can anyone guide me how to create a fetch request that will query an entity and returns any properties that qualify my criteria. Here's what I have. I have an entity that has 35 properties, all are in types of float. What I need was to see all properties of the entity which values was <= zero. I know how to return the values of the...

Do I have to copy and autorelease this string?

When stepping with the debugger through this, dfString is invalid after [df release] - (NSString*)dateFormatStringWithLocale:(NSLocale*)locale { NSDateFormatter* df = [[NSDateFormatter alloc] init]; [df setDateStyle:NSDateFormatterShortStyle]; [df setTimeStyle:NSDateFormatterShortStyle]; [df setLocale:locale]; NSStri...

Inherent UIView leak

When ran in activity monitor, the real memory usage for a program running the following piece of code will increase endlessly: CGRect frame = CGRectMake(0,0,0,0); while(true) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; UIView *test = [[UIView alloc] initWithFrame:frame]; [test release]; [pool release]; } What ...

How to change a date by changing AM / PM hours period in 12h format?

In the docs, Apple gives an example on how to add some hours and minutes to an existing date: NSDate *today = [NSDate date]; NSDateComponents *offsetComponents = [[NSDateComponents alloc] init]; [offsetComponents setHour:1]; [offsetComponents setMinutes:30]; NSDate *endOfWorldWar3 = [gregorian dateByAddingComponents:comps toDate:today o...

Secure way to figure out if a given date format has an 12h or 24h format?

I know this sucks. Date stuff sucks hard. But: Imagine a date format like "dd-MM-yyyy h:mm" how would you tell for sure what time mode that is? AM / PM or 24 hour? I'd say: If there is no "a" in the date format, then that's no AM / PM stuff and therefore it's nice 24h stuff. What do you think? ...

How to find performance bottlenecks in an iPhone app?

I feel my app has bad performance, and want to figure out which parts in code are evil. Is there a good tutorial somewhere on how to find these? ...

How to bind the symbols of an app on the device to Shark?

The docs say: Important: Shark cannot capture symbol information on the iPhone itself, so “raw” sessions recorded from an iPhone will appear in Shark labeled only based on sample address ranges. This can make it very difficult to understand the results that Shark returns. Instead, you must tell Shark to recover symbol...

UIGlassButton in iPhone

Has anyone submitted an applicaton using UIGlassButton? Was it approved? I am trying to use a colored rounded button and do not want to use these hacks. http://stackoverflow.com/questions/372731/how-can-i-set-a-button-background-color-on-iphone Why are we not allowed to use UIGlassButton? ...

SubViewTwoController undeclared (first use in this function) (obj-c)

Ahoy hoy everyone :) Here is a list of links. You will need it when reading the post. I am a newbie to Objective-C and try to learn it for iPhone-App-Development. I used the tutorial linked in the link list to create a standard app with a simple basic Navigation. This app contains a "RootView" that is displayed at startup. The startup...

setup coredata, before appdelegate loads my mainWindow.xib

Hi, I have setup coredata in my appDelegate, but it first loads the mainWindow.xib and the corresponding controllers+views in that xib file. Those controllers need to have a managedObjectContext to load properly. And after the xib is unarchived it runs the code in my appDelegate. How can i setup my coredata and then load the mainWIndow...

How to read a crash report from iPhone

Got a crash report from a beta tester and I'm having trouble identifying the root of the problem. Clearly something went wrong when trying to set a UIButton (screenOverlay). Here's its creation in ViewDidLoad: UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0, 0, self.view.frame.size.width, sel...

Selling an Upgrade to a Full-Featured iPhone App

Hello, I have two iPhone apps - one provides maps, online and off. The other includes the map application, and also provides a GPS recorder. I would like to sell the Offline Maps app, and then have an option within the app to upload to the full application. How would I go about doing this? In my code, I build two different targets aga...

Reference parent object

I currently have NSXMLParser working in my viewcontroller. I would like to create a new class that will have the 2 data elements as properties and do all of the xmlparsing. The problem I have is getting the new class to "alert" the parent when it is done parsing, etc. So the viewcontroller (the parent) can then turn off the activity indi...

Add a UIImageView as a subview of a UIViewController without using IB

In my UIViewController's viewDidLoad method I instance a UIImageView instance called stage: stage = [Stage viewWithParent:self]; and that calls this: - (id)initWithParent:(UIView *)parent { self = [self initWithFrame:CGRectZero]; if (!self) return nil; [parent addSubview:self]; return self; } + (id) viewWith...

How to present a modalview on top of other modalview

Ok, this might be easy.. To present the first view controller modaly : WelcomeViewController *userWelcome = [[WelcomeViewController alloc] init]; [self.navigationController presentModalViewController:userWelcome animated:YES]; [userWelcome release]; this far everything is fine. But, how to pull a second view controller modaly on this...

Which UI element for day-switching bar?

In the Calendar app on the iPhone, when displaying a day, you can switch to the next an previous day with a gray bar at the top. My question is: which interface element would you use for that? UIToolbar, UITabbar or a UINavigationBar? UINavigationBar provides pretty much what I need: the possibility to add a button at the left and at t...