iphone

Is it true that one should not use NSLog() on production code?

I was told this a few times in this very site, but I wanted to make sure this is really the case. I was expecting to be able to sprinkle NSLog function calls throughout my code, and that Xcode/gcc would automatically strip those calls out when building my Release/Distribution builds. Should I avoid using this? If so, what alternatives ...

iPhone Simulator: SpringBoard failed to launch application with error: 7

Building an iPhone project results in: Failed to launch simulated application: SpringBoard failed to launch application with error: 7 And the app doesn't install on the simulator. What's this all about? What's SpringBoard and what is error 7? ...

Is there a way to get the carrier information of an iPhone user programmatically?

Aside from using the region to infer which carrier the user is under. ...

How can I disallow use of a application feature based on if the device is a 3G or Non-3G device?

I want to allow only users with a 3G phone to use a particular GPS function. How do I run a check on the device before allowing that feature to be used? ...

Sound not working in iPhone Simulator?

Somehow my iPhone Simulator is unable to play sounds. First an app I'm working on using AudioServicesPlaySystemSound() stopped working.. I spent a while debugging this but sound is still working on the iPhone when I run the app on the device. I get the same results with other iPhone apps such as the sample Crash Landing app. I can't f...

Generating iPhone Camera Roll Thumbnails

My iPhone application needs to save an image in the Camera Roll. I need to generate the .THM file because otherwise the photo is not recognized by the iPhone. Are there any Objective-C API to do it? Thank you. ...

Submission and pricing of iPhone application to Apple Store

Hi All, I have worked on iPhone application but not aware of the formalities to submit it to Apple Store. Please somebody help me out to solve the following queries: Are their any submission charge to be paid? And Procedure to submit application to Apple Store. Thanks & Regards, Khushi ...

How would you construct and interact with a grid like a Sudoku board?

What do you think is the best way to implement an interactive grid similar to a Sudoku board for a native iPhone application? I did not see an object to fill this need in the SDK. Should I make a custom control for an individual cell, then initialize as many of them as I need in a grid form? Any and all comments are welcome. Thanks!...

Frogger for iPhone

Most of my programming experience has either been using forms (Windows Forms, or ASP.NET) or small embedded projects interfacing hardware. Recently I began going through some tutorials for iPhone development. I'm interested in learning Objective-C and the iPhone sdk. I wanted to make a small frogger-like game to help me learn but I've ...

Best way to save data on the iPhone

I am writing an iPhone application, and need to save the state of my application (5K or so). My main worry is data persisting across upgrades. Some of the applications I use clearly got this wrong, and I would prefer not to! ...

best way to save/load iphone game data

I'm working on a puzzle game, the game engine holds a complex hierarchy of objects, from game actors to vectors to transition animations. Depending on the game state, they might add up from 10 to 1000 (in extreme cases). I've been delaying the moment until I'd have to work on the saving and loading of all that mess, as I have no experien...

Algorithm: Keeping count of key/value pair in NSDictionary

Being new to Cocoa, and probably not knowing all of the potential classes available that already have this functionality neatly wrapped in an OO class, here's an algorithm inquiry. What's the best bet to count how many times a particular key occurs in an array of multiple NSDictionary instances? Essentially my data structure (in this ca...

Best way to load an application like it was in its previous state when it was terminated

I would like to learn the best practices in reloading the application state, such that when my app is started, it should automatically load the "correct" view/subview when it is opened again. In my particular case, my app has a bunch of view controllers, each taking care of a UITableView. I would like for my app to "jump" to the correct...

How to add a UIButton at runtime

I am trying to add a UIButton at runtime however it is not visible. What am I doing wrong? - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { UIButton *btn = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain]; btn.frame = CGRectMake(0, 0, 100, 25); btn.backgroundColor = [UIColor clea...

How to reset the scroll position of a UITableView?

I would like to completely reset the scroll position of a UITableView, so that every time I open it, it is displaying the top-most items. In other words, I would like to scroll the table view to the top every time it is opened. I tried using the following piece of code, but it looks like I misunderstood the documentation: - (void)viewW...

Are download usage statistics available through the iPhone API?

You're my last hope stackoverflowers. ...

Is it possible to configure a UITableView to allow multiple-selection?

Hey there, For the iPhone, is it possible to configure a UITableView such that it will allow multiple-selection? I've tried overriding -setSelected:animated: for each UITableViewCell, but trying to fudge the required behavior is tricky as it's difficult to separate the real unselections from the ones where the UITableView thinks I've u...

IPhone sync/app backup - can an app do something at that time?

Hi I was wondering if there is a hook in the iphone sdk that allows an app to know when its being sync'd / backed up - so that it could do something, eg connect to a website to also backup data. I am assuming not... but I could be wrong. Thanks, Chris ...

Procedure to submit iPhone application to App Store?

Hi all, Is it necessary to pay $99 before I can watch the video to submit an iPhone application to the App Store, or it is available free of cost anywhere? Please help, it's urgent. Khushi ...

Reasons for rejecting iPhone application by Apple store

Can anybody help me out to know the possible reasons for which Apple store can reject or raise objection to submit any iPhone application. ...