iphone

problem in parsing XML in iphone SDK?

i have used following code to parse the xml file but i can t get value...anyone can help me..? (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { if([elementName isEqualToString:@"Quer...

UIView and UIViewController practice for inheritance

Hi, I was just wondering if this approach looks like a good practice for apps with a lot of custom views, for nested PNG graphics and animations that may change based on user interaction. I created a BaseView class that extends UIView @interface BaseView : UIView { @protected BaseViewController *controller; } @property (retain...

Does someone know what's the magic behind the Render-Tree?

The Layer-Tree and Presentation-Tree are pretty clear. But the Render-Tree is not. Since it is private API and Apple doesn't talk much about it, I would still like to know more details about what's going on there. Does anyone know? ...

updating iPhone apps via the web

I'm working on an eBook app for the iPhone. Given the time it takes for Apple to review and publish updates, I'm considering adding a feature to update the content via my own (Google App Engine-powered) web site. This would allow me to update the content at will, rather than being at the mercy of the App Store review team. Is Apple ...

How much does it matter regarding to memory if I create an CALayer rather than an UIView?

While an UIView has a memory footprint of at least 4 * width * height pixels, I wonder how that would look when I create a CALayer only. ...

in which situations does it make sense to create only an lighteight CALayer rather than a fat UIView?

The only thing that comes in my mind is displaying simple images. But that wouldn't make sense if you want to animate them, right? So is it any useful to make a CALayer only instead of an UIView that comes along with a whole bunch of them (all those trees...)? ...

How to reposition UITableView?

I have a UITableViewController and I want to add a navigation bar to it. So after the navigation bar (which works fine), part of the original tableView is being covered up by the nav bar. I tried to reposition the table view using this: self.tableView.frame = CGRectMake(0, 44 + 20 /* height of navbar + some margin */, 320, 416); But ...

Does the -presentationLayer tell me the in-flight values of an view while it is beeing animated?

The doc says: presentationLayer Returns a copy of the layer containing all properties as they were at the start of the current transaction, with any active animations applied. And somewhere else Apple said, that the presentation layer contains the values like they are currently displayed to the user. So when I ask for this ...

How is layoutIfNeeded used?

When and how is layoutIfNeeded used? I know that when we change the layout of a view, we can call setNeedsLayout to update the layout but not sure when layoutIfNeeded should be used. NOTE: I have layoutIfNeeded used in actual code but forgot in what context it was used. ...

Login / Logout on an iPhone app

I would like to know about managing user's login and logout on IPhone native apps. For example, every time my app is running, the user must be logged in. The information the app serves and the list of users it's on a website running php+mysql. What's the "standard" procedure for this? Is there any library for handling user's login on a r...

Little-endian hex in GHKit diagnostic, why?

In the context of iPhone programming, I am using the GHKit for unit testing (gabriel / gh-unit on github). Here is a failing test assertion : GHAssertEquals(150, 15, @"someLimit"); and here is the diagnostic from GHKit (shows up in the Simulator and in the Xcode Console) : 2009-07-25 22:41:12.553 UnitTests[38404:3f07] Exception:...

Help with Points between rounds in objective-c

I am new to objective-c and am having trouble figuring out a way to store points for multiple players in my game. I have 4 characters in my game that are all objects from the same class. 1 is controlled by the user and the other 3 are controlled by the computer. Each level in my game consists of 3 races. I need a way to keep track of eac...

What's your method for this... wiping out your DocumentsDirectory during iPhone development?

I'm sure there is a better way to do this. I have this chunk of code that I use to wipe out the DocumentsDirectory on an iPhone or Simulator. Sometimes I just want a clean slate, and sometimes I make changes to a database and I need to rebuild it. So, in one of my functions that gets called when I turn on my app, I have this code comme...

How do I do a simple WHERE with foreign keys using SQLitePersistentObjects?

I have two entities deriving from SQLitePersistentObject. @interface EntityA : SQLitePersistentObject { //stuff goeshere } and @interface EntityB : SQLitePersistentObject { EntityA *fk; } @property (nonatomic, retain)EntityA *fk; How do I find all instances of EntityB whose fk is a specified instance of EntityA? ...

Play Alert Sound (Vibrate) While AudioQueue is Recording

It seems that it's not possible to play an alert sound AudioServicesPlayAlertSound(kSystemSoundID_Vibrate); while the AudioQueue is being used to record audio. Is that correct? Maybe I'm doing something wrong. Is there a way to do this other than pausing the recording? TIA. ...

Best practice to proxy a value to a ViewController through its parent ViewController?

I have a view controller (let's call it MainViewController) that contains a UITabBarController, where each TabBarItem connecting to its respective UIViewController-derived classes. For certain UIViewControllers, I want to pass in value at the time via MainViewController. What's the best way to do this proxy'ing? Right now, I end up ha...

Loop and changing variable.

Hello, I have a for loop as below which populates this data into an array. I would like this to essentially populate 15 different array's, I have written some Pseudo code below. Is this achievable? for (int y = 1; y < 16; y++) { NSArray *array + y = item } ...

Removing text shadow in UITableViewCell when it's selected

I've added a text shadow to cells in my UITableView to give them an etched look: cell.textLabel.textColor = [UIColor colorWithWhite:0.2 alpha:1.000]; cell.textLabel.shadowColor = [UIColor whiteColor]; cell.textLabel.shadowOffset = CGSizeMake(0, 1); Since the shadow color is actually white, when a row gets selected and becomes blue, th...

Getting a reference to the UIApplication delegate

I'm writing my first iPhone application and I'm having trouble switching views. I have 2 views and a reference to each in the AppDelegate (an instance of UIApplicationDelegate). I create instances of both in the applicationDidFinishLaunching and immediately show the first view. This works fine. The problem is the reference to the o...

Filling Array with Custom Class - retrieving values...

I have the following code NSMutableArray *leeTemp = [[NSMutableArray alloc] init]; Player* playerLee = [[Player alloc] init]; playerLee.name = [array objectAtIndex:1]; [leeTemp addObject:playerLee]; [playerLee release]; And this generates an array of Players (I think)! When I do the following it shows the addresses of the Players. N...