Rounding a float to 1/4ths in Objective C
what's the most elegant way of rounding a float to it's closest 1/4ths in Objective C? For example: 3.14 should be 3.25 2.72 should be 2.75 6.62 should be 6.50 1.99 should be 2.00 etc. ...
what's the most elegant way of rounding a float to it's closest 1/4ths in Objective C? For example: 3.14 should be 3.25 2.72 should be 2.75 6.62 should be 6.50 1.99 should be 2.00 etc. ...
In my game/app (iPhone) the client side sends http requests (get or post) to the game http server. Requests have this form: gameserver.com/userId/givebonus/100 This for example would give the userId a bonus of 100. Now, we encrypt the server request and it will become something like: gameserver.com/42c34c234c234/ghjghjg4hj32g42jh2/42...
I am building an iPhone app. Currently when I close the app and relaunch it, it relaunches on the last viewed view. Instead I want to be able to reinitialize the app, and present the view that's most appropriate for the application's state (based on what's in the database). How can I do that? ...
Hello, Can you show me the syntax or any sample programs to archive an NSArray of custom objects in Objective-C? ...
I'm planning to write iPhone app which have to be able to play QTVR (QuickTime Virtual Reality) movies (it'll be one of its core features). I know there are couple of apps capable of doing it, thus I'm wondering if there is any library available that supports playing such content? ...
Hi All, I have created a dictionary with a number of different bits of information all pulled from and xml feed. I now want to pull certain parts from the dictionary into areas to create my tableview. so far creating the section headers was fine, but having a problem with the numberofrowsinsection part: - (NSInteger)tableView:(UITable...
I used some code like below: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms://123"]]; what would happen if it runs in ipod touch how to target iphone user only when publish the app to the store. ...
Hi all, I'm trying to switch from two-stage rotation to one-stage rotation (to avoid the console warning, and because Apple recommend doing so because one-stage is faster). However I can't figure out how to get the new size of my view (taking into account the navigation bar, status bar, etc) early enough to perform the update of my UI ...
Hi there, I'm animating a shrinking object. At any point the user can hit a button to get the current scale factor of the object. (I start by scaling the object up using a CGAffineTransformMakeScale, so the scale factor should be 1 when it reaches its original size). I'm just not sure how to retrieve the current scale factor from the ani...
Hi, i have a plist which goes like this: <dict> <key>11231654</key> <array> <string>hello</string> <string>goodbye</string> </array> <key>78978976</key> <array> <string>ok</string> <string>cancel</string> </array> i've load the plist using this: NSString *path = [[NSBundle mainBundle] pa...
I have searched many questions on ObjC accessors and synthesized accessors to no avail. This question is more of a "help me settle an issue" question; I don't expect one answer, but I'm rather looking for experts to weigh in on the argument. In a Cocoa Touch class, I would write some code like this (where soundEffects is a synthesized ...
I am creating a view like this: UILabel *qty = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 20)]; qty.backgroundColor = [UIColor whiteColor]; qty.text =[NSString stringWithFormat:@" Qty: %@", currentQty]; qty.alpha = 0.5; [qty setTag:999]; [self.view addSubview:qty]; [qty release]; This can happen multiple times in this view c...
.hidesBottomBarWhenPushed = NO; doesn't work because the view isn't getting pushed. I want the tabBar to be hidden on the first screen and able to show it again a few screens later. How can I do this? ...
Since I'm used to developing in Java, I'm familiar with what files get generated by the build process and can tell what files to exclude from SVN and HG when I do comits. I'm just starting out learning some iOS app building using XCode. With XCode and Objective-C on a Mac, I don't know what files get generated. If there are files sp...
I recently switched my application from 32 bit to 64 bit on Mac OS X. The only problem that I am having now is some users are complaining that their existing keychains are not being saved anymore and they cannot create new ones. Is there any reason the keychain service would stop working after such a switch? The actual code to process th...
Recently I realized I needed to add an argument to the init method for a helper class I've got. The helper class deals with alert views so it already has a bunch of arguments in the init, which are looked at, tweaked, and then sent on to the alert view. Since I'm using the method as it is in various places, I don't want to risk crashin...
I've got an Custom UIButton. It's got a "static" background image a variable text (the Title) which gets set in the code Now I would like to add an icon (UIImage/UIImageView) inside the button on the left of the text. (I use the indent to move the text slightly to the right). Is there an easy way of adding that icon (and referencin...
Hi, is there any Possibility to create a image out of a UIView? Thanks, Andreas ...
Hi, i am running xcodebuild command from terminal but getting the following error ATION (Release) === Check dependencies error: There is no SDK with the name or path 'iphonesimulator3.1.3' [BEROR]error: There is no SDK with the name or path 'iphonesimulator3.1.3' ** BUILD FAILED ** what is the possible reason i m getting this error ?...
How do you calculate the focusPointOfInterest (a CGPoint value between 0,0 and 1,1) for an given AVCaptureDevice? I've been following the code samples from the latest WWDC but I really don't understand how to calculation is being made. Also, my application is sitting in landscape vs. portrait (as in the sample) ... so in addition to no...