iphone

UITabBar view / frame

Hello, I have an app that uses a UINavigationController. On one of the pages, I add a UITabBarController in my viewDidLoad method. Once I'm done initializing and configuring the UITabBarController, what is the appropriate way to make the UITabBarController's contents visible? If I use: [self.view addSubview:self.tabBarController.vie...

Create a static library that can be weak linked

Is it was possible to add objects/classes to a static library in a way that would let them be excluded when the library is weak linked? I tried adding attributes to my obj c classes that tag them as "weak_import" but the compiler says it is undefined. ...

Formatting number as percentage

I don't understand how NSNumberFormatterPercentStyle works! Example: NSNumber *number = [NSNumber numberWithFloat:90.5]; NSNumberFormatter *percentageFormatter = [[[NSNumberFormatter alloc] init] autorelease]; [percentageFormatter setNumberStyle:NSNumberFormatterPercentStyle]; NSString *strNumber = [percentageFormatter stringFromNumbe...

Try Catch Statement doesn't work on Simulator (but works on iPhone!!!)

Hi I have an Exception catching statement in my code, like the following: @try { for(NSDictionary* s in users) { do something .... } } @catch (NSException * exception) { NSLog(@"APIRequesetBase readUserInfo: Caught %@: %@", [exception name], [exception reason]); } @finally { } So this try stat...

Loading tableview from the mutable array

hey people im having trouble with loading my array of strings into a tableview , what i have already done is parse information and stored the data i need into an mutablearray of elements called statues1, now what i want to do is load up the statues1 into the table view with customize lable so the user can see all the values , now my prob...

How can I stop CALayers from animating?

Hi all, I've created a bunch of sublayers within my view, populating each one with a graphic, so effectively they are sprites. However, when I call [lineLayer setValue:[NSNumber numberWithFloat:0.5] forKeyPath:@"transform.scale"] it appears to 'tween' to that size instead of just appearing at the new scale. Is there any way of switchin...

iPhone sdk getting data from php

Hello, i have a problem with my iPhone application. I want to read a mysql database, one method is to serve the data over php. My php file looks like this: <?php $db_verbindung = mysql_connect("localhost", "root","") or die ("Keine Verbindung moeglich"); $db = mysql_select_db("testdb") or die ("Die Datenbank existiert nic...

Supporting iOS versions prior to 4.0/3.2 and problems with NSClassFromString

Hello, I'm currently developing iPhone applications that -- for the time being -- need to be supported on versions prior to 4.x. When I want to use something 4.x or 3.2 specific, I would use the usual approach of checking if a given class exists, i.e.: if(NSClassFromString(@"SomeClass")) { // do stuff here } This mostly works, exc...

Drawing a 'turning wheel' using Core Graphics?

Can someone provide an example of drawing an iPhone-like turning wheel using Core Graphics. I know it can be done by drawing a sequence of lines but that requires a math formula to work out line points. Can someone help me with that? Here is how it should look like: It looks like it is made up of several lines with rounded edges and ...

UIButton won't go to Aspect Fit in iPhone

I have a couple UIButtons, and in IB they're set to Aspect Fit, but for some reason they're always stretching. Is there something else you have to set? I tried all the different view modes and none of them work, they all stretch. ...

iphone local database synchronization with remote server master......

I've tried googling this with very few helpful answers....basically I have a master database sitting on a linux server with a partial local copy sitting on the iphone. The database gets updated a few times every minute and I would like to somehow transnit (push, pull, or poll) the changes in real time to anyone using the app on the ipho...

Initalize A UISegment Control

I want to initialize my uisegement control to the second option. So when a button is clicked I want to set the uisegement control control to option 2. ...

Remove keyboard or place Picker View on TOP of keyboard

Anyone has any idea how one can achieve the same look as when you press on the "From:" in the Mail iphone app when you have more than one user account. I'd like to remove my keyboard, but WITHOUT animating it. Rather just disappear and instead of it have a UIPickerView appear. Thanks much! ...

Retain count for tableView:cellForRowAtIndexPath:

In Apple's example code, the method tableView:cellForRowAtIndexPath: of a UITableViewDataSource returns a cell with a retain count of 1; it allocs it, but doesn't autorelease it. However, the static analyzer complains that this violates the Cocoa naming conventions, since the method name doesn't start with 'new', etc. The documentation d...

How to remove the highlight selection in Pickerview?

Hi, everyone.. I've been trying every day on how to remove the blue highlight in Pickerview. I found nothing useful at Google, but here I found this link: http://stackoverflow.com/questions/958443/overriding-highlighted-selection-in-uipickerview/1785804#1785804 But, when I try to implement that in my app, nothing happens, the blue hig...

MFMailComposeViewControllerDelegate setMessageBody problem

Hello guys! Here's my code: if (!_mail) { _mail = [[MFMailComposeViewController alloc] init]; _mail.mailComposeDelegate = self; CGRect mailRect = _mail.view.frame; mailRect.size.height = self.view.frame.size.height; mailRect.size.width = self.view.frame.size.width; _mail.view.frame = mailRect; _mail.vie...

Best Practice: iPhone app communicating to php script hosted on server

My iPhone app communicates with a php script hosted on a server. Hard coded into the app is the domainname.com/phpscript.php?=data If something happens to my domain name, the app won't work. Is there a best practice for handling this. Do you suggest a DNS or something? I'm just looking for ways to avoid a complete resubmission to apple,...

Distributing apps compliant with iOS 3.0 +

I've been working on an app that I've successfully built for iTouch, iPhone 3G, iPhone 3GS, iPhone 4, running iOS 3.0+. It worked fine when I plugged it in to Xcode and built from there. However, after submission to the app store, it only builds on iOS 4.0. Are there any obvious reasons why? My build settings were: Active Architecture: a...

How can I view the values inside an object in the Xcode debugger?

I know that might sound like a stupid question since it's a trivial feature in most modern IDEs, but I'm diving into iOS development and am getting familiar with the platform and SDK and I can't figure this out. I have a ton of experience with MS Visual Studio and I see that Xcode works very much the same, tho it's still lacking quite a...

Quick overview of the structure if iPhone apps

Can someone give me a quick, one-to-few paragraph(s) overview of the structure of iPhone apps. I'm working my way through a book, but I can't really understand the purpose of App Delegates, MainWindow.xib vs. individual views' nib files, actions vs. outlets, etc. I'm looking for a high-level description, because all I can find are real...