iphone

iPhone platform: endianness (detection & swapping)

Hi all, I'm doing some endian-sensitive file manipulation on iPhone. Are there standard macros or #defines in that environment that indicate native endianness and offer swapping if necessary? I know I can check in advance and just do the right thing for this particular architecture, but wondering if there are cleaner ways of doing the ri...

Display Text From a Document's File - iPhone SDK

Does anyone know how to display a text file, if its in the "Documents" folder of the iPhone application? The extension might not always be ".txt", but I would like to give it a try. Thanks, Kevin ...

iPhone backup & restore does not restore our app's data on rare occasions

We have an iPhone app with several thousand users, and we've had one or two users saying that after a full backup & restore procedure within iTunes, the data for our app was lost. All the data (photos & SQLite DB) are stored in the documents area of the app. I've tested this thoroughly with our devices and it works absolutely fine. Can...

Difference between writing to file atomically and not

What is the difference in writing to files atomically on the iPhone in objective-c and not, is there any performance difference between the two? Thanks in advance! ...

Compile/use unrar C++ source for iphone app?

Writing an app that will include the ability to decompress zip and rar files. I think I'm OK on how to handle the .zips but .rars seem a little more trouble. I noticed that rarlabs has source available but it's C++. Is there a way to compile, wrap or otherwise use this code within an iPhone app? Reference: http://www.rarlab.com/rar_add....

Trying to force redraw of UITableViewCell

I found this post on Beveled UITableViewCells from http://news.selectstartstudios.com/beveled-uitableviewcells/. I'm using the technique to reduce the width of the cells, and for the most part it works great. However, I have a small problem. Sometimes the cells are not redrawn properly. For example, even though a cell is supposed to be ...

Need to dealloc all views in navigation controller

Hello, I'm trying to set up an in app purchase and once the purchase has been made I need to reset the app to its initial launch state. I'm wondering if there is a way to dealloc all the view controllers inside of each navigation controller and reload the initial view that is displayed when the app launches. Thanks in advance! ...

Push a ViewController and It Pops Right Back

I have a view controller with a table view and a UISearchBar. When the view controller is first brought up, the table is populated. A click on a table row pushes another view controller, it animates up and then pops right back down and returns me to the table. It does this whether the search bar has been used or not. I do this push po...

Does new iPhone developer agreement pretty much kill CS5's feature to export to iPhone app?

Will CS5's Packager for iPhone still be an option when CS5 comes out? Or, will any apps submitted to the App Store be denied because of the new restriction that the app has to be written in Objective-C, C, C++, and/or AppleScript(?)? ...

Size of static libraries generated by Xcode

I have a project tree in Xcode that looks like this: AppProject depends on ObjcWrapper which in turn depends on PureCppLib. ObjcWrapper and PureCppLib are static library projects. Combined, all sources barely reach 15k lines of code, and, as expected, the size of resulting binary is about 750Kb in release mode and slightly over 1Mb in de...

Using Unit Tests While Developing Static Libraries in Obj-C

I'm developing a static library in Obj-C for a CocoaTouch project. I've added unit testing to my Xcode project by using the built in OCUnit framework. I can run tests successfully upon building the project and everything looks good. However I'm a little confused about something. Part of what the static library does is to connect to a UR...

Change UISearchBar/Keyboard Search Button Title

In the UISearchBar control, is the a way to change the Search key title for the keyboard to Done? ...

NSKeyedArchiver and NSValue - How to Archive?

How do I archive an array of NSValues ? What conversions should I make to do this? It won't archive it as is. Code: [[NSUserDefaults standardUserDefaults] setObject:[NSKeyedArchiver archivedDataWithRootObject:[[NSArray alloc] initWithArray:drawingsArray]] forKey:@"NSValuesArray"]; Error: *** Terminating app due to uncaught exce...

How to popViewController from button click of custom UITableViewCell

I have a button in a custom UITableViewCell. Its UITableView is controlled by a UIViewController. I would like to return to the RootView when that button is clicked. I am trying to use [self.superview.navigationController popViewControllerAnimated:YES]; in the target Action of the button, which is in the UITableViewCell.m file. How...

Ensure User has entered string in correct format?

Hi, Whats the best way to ensure the user has entered a valid time string such as: 5:24 5.4 102:30 102.5 It will be entered into a UITextField therefore will be in a NSString. I want to allow the user to enter the time in either hours and minutes (hh:mm) or hours and decimal minutes (hh.m). In the hours minutes example they should ...

Objective-C iPhone - NSMutableArray addobject becomes immediately out of scope.

ok. I have a really odd and mind boggling problem. I have two class files, both of which are NSObject inheritors. The series of code is as follows CustomClass *obj; obj = [[CustomClass alloc] init]; [myArray addObject:obj]; <--------Immediately after this line if I hover over the array it shows it as having 1 object that is out of ...

Displaying very large images on the iPad

I need to display some very large images on the iPad. The files are jpgs and are about 6700x2700 (maps). Is there any way around loading the entire image into memory? Currently I load it int a scroll view for zooming/panning. The images are stored locally on the device. ...

viewForHeaderInSection disappears when scrolling

I am using a custom header view in my UITableView, but as soon as i begin scrolling down the header disappears instead of staying in place like with the default headers. And it's not scrolling off the screen either, just completely disappering. viewForHeaderInSection is still being called but the drawRect method of my custom header view ...

Any idea about an iPhone Accelerometer Library?

Have looked so long for a library specialized in dealing with iPhone Accelerometer but couldn't find anything. I have made some few sample apps, but none reaches a level of accuracy as in Labyrinth games for example, so any idea about a library for that? Or maybe an open source app? Would be better if it's integrated in a Physics libra...

Do I have to call release on an objective-c retain class variable when setting it to a new object?

Say I have: @property (nonatomic,retain) NSString *foo; in some class. And I call: myclass.foo = [NSString stringWithString:@"string1"]; myclass.foo = [NSString stringWithString:@"string2"]; Should I have called [myclass.foo release] before setting it to "string2" to avoid a memory leak? Or the fact that nothing is pointing to th...