iphone

How to move a view or label in x direction using CABasicAnimation in iPhone

Hello all, I am using the following code to move a label from one position to another in x direction CABasicAnimation *theAnimation; theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; theAnimation.duration=1; theAnimation.repeatCount=1; theAnimation.autoreverses=NO; theAnimation.fromVa...

UITableView with images not releasing resources

Hi, I have a UITableView where each cell is an image. Only one cell is visible at a time. The images are loaded on demand. The user scrolls to a cell and its image loads. Thi is my cellForRowAtIndexPath method: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *M...

How can I test if my framebuffer object is rendering properly?

I'm using a framebuffer object with a color buffer attachment to do some per-pixel hit testing. I'd like to render it to the screen for debugging and testing but right now all I'm getting is a big white nothingness. I assume I have to send some render command similar to glSwapBuffers(), but as I'm only using one buffer I don't know wha...

Key value Observing during UIView Animations

Hi, I'm animating the center property of a view in my program. During the animation, I need notifications when center hits a particular value. I tried adding the myself as a key value observer for the center property of the view . However, I only get notified when the animation begins. So I'm unable to detect if/when the object passes ...

Including stdc++ from iPhone app

I'm trying to use clucene from inside an iPhone application, and I'm running into issues with my include statements. Specifically, imports like stdexcept, vector, etc are failing. The same code compiled fine under XCode using the x86_64 sdk, but fails when I switch to the iPhone Simulator 3.1 sdk. It seems like XCode might be changing ...

Saving Interface Builder Changes when building in Xcode

I know many of you have experienced the same the scenario, where you are banging your head against the wall wondering what is wrong with your app only to find that you have forgotten to save your Interface Builder changes. Well, this never happens to me, because for some reason Xcode will prompt me to save any changes in Interface Build...

Cocoa-Touch, NSManagedObject: Exception when setting a property.

I have a NSManagedObject subclass, created by the XCode model interface. This class has some NSString and NSNumber members, and a NSDate member. When I try to set the NSDate member, I get the following exception: 2009-10-12 21:53:32.228 xxx[2435:20b] Failed to call designated initializer on NSManagedObject class 'Item' 2009-10-12 21:53:...

Weird SPAN element rendering in Safari (on iPhone)

Hello, Whenever there is a SPAN element in HTML content, the mobile version of Safari renders content differently- it seems that font size increases for the whole paragraph. Consider two examples. <div style="border: 1px solid red; width:500px;"> <p>This is a paragraph. This is a paragraph. This is a paragraph.</p> </div> and <div s...

UITabBarController moreNavigationController table cell background images

Wow, was that ever a mouthful. :) We've already seen a good thread on customizing the more menu (table view) in a tab bar. For our next trick … how might one add a background image to the table cells? I thought I could get away with overriding tableView:cellForRowAtIndexPath: in my More Table View's Data Source class (see earlier link...

How Does Mac OS X know to Display .app folders as files?

I distributed an iPhone application to some testers who are using Windows. On their machines, the application that I built (in the form of an .app bundle) appeared as a directory. That makes sense because a .app bundle is actually a directory. What mechanism does Mac OS X use to display these bundles as files within Finder? Is there ...

To retain or not to retain

If I am adding an item to a dictionary like this: [connectionHandlers setObject:projectsHandler forKey:[NSNumber numberWithInt:PROJECTS_CONNECTION_ID]]; Should I be retaining the NSNumber used for the key. Also, when an object is added to an NSArray or NSDictionary, is it retained by the Array or Dictionary when added and released wh...

iPhone - Maximum Download 3G Size MB

I have heard the maximum download size for an app through ATT wireless 3G network is 10MB, anything over that size you will need a wireless router to download the app. I am building a game with numerous images and am trying to keep it under 10MB. Does anyone know if the xcode app's binary file cannot be 10mbs or the itunes .ipa file ca...

Scrolling in Open GL ES

Hi, I would like to scroll an object in my iPhone Screen. I am using OpenGL ES. It is not like a background scrolling that occurs in a game. It is just like, when the user touches it and scrolls when he/she wants to. Can someone please tell me how to do it? Thanks :) ...

Replace " " character in an NSString with "\ " (to create a Unix path)

Using the following doesn't work: - (NSString *)stringByReplacingOccurrencesOfString:(NSString *)target withString:(NSString *)replacement By doesn't work I mean does not do any replacement what so ever. It returns the same exact string. Is there a convenience method to do this? Similar to: - (NSString *)stringByReplacingPercentEsca...

Objective-C: Best way to access REST API on your iphone

Hi guys, been wrestling with this for some time. I am trying to access a REST api on my iphone and came across the ASIHTTP framework that would assist me. So i did something like //call sites, so we can confirm username and password and site/sites NSURL *url = [NSURL URLWithString: urlbase]; ASIHTTPRequest *request = [[[ASIHTTPRequest a...

Take some object in NSArray and put it randomly in labels

I choose index of an array from a plist. It's a dictionary with 10 different line with string. NSArray* tableau = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"codes" ofType:@"plist"]]; NSDictionary* phrase = [tableau objectAtIndex:nombreChoisi]; I would like to take 6 elements and put them in 6 labels...

I think I lost my Managed Object Context

So I'm working on a clone of CoreDataBooks. It's a little different. When the '+' button is pushed, it launches a navController, containing 2 views. The first (AddPatientVC) asks for name of the Patient then its pushed to a 2nd View Controller (AddPatientDetailVC) which asks for more detailed information. It's the 2nd view controller th...

How to trap the back button event

I have a UITableViewController that launches a UIViewController and I would like to trap whenever the back button is pressed in the child controller, which is the class that derives from 'UIViewController'. I can change the Back Button title but setting the target & action values when setting the backBarButtonItem seems to get ignored. W...

iPhone SDK: loading UITableView from SQLite - creating array from SQLite

Hi, this is a follow up forr http://stackoverflow.com/questions/1552944/iphone-sdk-loading-uitableview-from-sqlite I am planning to use following code to load SQL data to the array. Each element of the array will be a class represening each database entry: @interface Row : NSObject { int PK; NSString *desc; } @property int PK...

Core Data Migration Across Multiple Version Upgrades

I have an iPhone app that uses Core Data. I did an update and used Lightweight Migration to go from V1 to V2 of my MOM (Managed Object Model). This worked perfectly. What happens when I want to go to V3 (and beyond) of my MOM? If I decide to continue with Lightweight Migration, will it automatically deal with migrating from V1 to V3...