iphone

How to word wrap text in annotation subtitle

I tried to insert return and newline chars into the subtitle string, but they ended up as "spaces" and not line breaks. Since subtitle is simply an NSString I must look at the container, which likely means I'll have to roll my own annotation views. The NSString do become f.ex. "90510\nHollywood, CA", but maybe I have to 'encode' the new...

iPhone SDK: Track users location using GPS

I have a few questions about CoreLocation and GPS. First, what method in core location is used to continually get the users current coordinates? And at what interval should these be retrieved? Second, should these coordinates be pushed into a NSMutableArray each time they are received, so that the array of coordinates will represent...

How do you use zlib to inflate a large file?

I am having trouble unzipping a 4mb(40mb uncomporessed) file on the iPhone. I have found many solutions, but none of them seem to work. They all rely on the zlib package, and now I am trying to use zlib directly. It would be great if someone could point me to a simple explanation/example of how to use it, as the documentation is thin ...

iPhone navigation controller basic question

This is a basic question about navigation controller, however, I don't seem to get it right. I am creating a basic navigation controller application and using my custom view instead of the default rootviewcontroller and rootviewcontroller.xib that are automatically generated. Here is what I have done: Opened the MainView.xib and del...

How to populate AudioStreamBasicDescription for AMR playback

source data is AMR-NB 5.9kbit/s (AMR_5.90) I've tried the below settings (and a dozen variations) but I'm getting nothing more than garbage audio. Does anyone know the correct settings for AMR? AudioStreamBasicDescription asbd; asbd.mSampleRate = 8000.0; asbd.mFormatID = kAudioFormatAMR; asbd.mFormatFlags = 0; asbd.mBytesPerPacke...

NSSortdescriptor, finding the path to the key I wish to use for sorting.

Hi I am using an NSSortdescriptor to sort a collection of NSArrays, I then came across a case where the particular NSArray to be sorted contains an NSDictionary who contains an NSDictionary. I would like to sort from the string paired with a key in the last dictionary. This is how I would reference the string: NSDictionary *productDic...

getting the same value in each cell of table view in objective-c.

i have check by printing the value of the cell.textlable.text in each iteration of the loop each time the value of it is as i want, but as the time of output on the simulator the value is come same for each row of cell. my code: for(i=0;i<[appDelegate.books count];i++) { Book *aBook= [appDelegate.books object...

Using SecKeyRawSign on the iPhone

I'm trying to sign some data using SecKeyRawSign but I keep getting a -4 errSecUnimplemented. That seems strange since the documentation states that it is available in iPhone OS2.0 and later. Has anyone been able to use this function? If so, are there any tricks involved? ~Nate ...

push viewcontroller using UINavigationController sometimes calls viewDidAppear: and viewWillAppear:

When pushing a viewcontroller using UINavigationController into the view: What is necessary for it to trigger viewDidAppear: and viewWillAppear: ? What makes it fail to not trigger viewDidAppear: and viewWillAppear: ? We are having a hard time relying on wether those methods gets triggered or not. ...

fire multiple batch sql statements on iphone sqlite

hi all, i use sqlite as db for my iphone project. i wanted to execute below 4 sql statements at 1 shot using a single prepare statement (like a batch of multiple sql queries) but it seems only the first statement in the batch works what is the best way for me to sort this out (except for using multiple statements within a transaction) ...

iPhone Map: Distinguishing Users Location from Other Pins

I have a number of annotations on my map, in addition to the users current location. This works fine, except the default color for the users current location is the same as all of the other annotations. I'd like to make the pin green for the users current location so that it's uniquely identifiable from the other pins. How do I do this? ...

How to set up a database and API web page to accept POST updates from iPhone?

Hi there, I am developing an iPhone app, which now can update Twitter account with GPS coordinates in real-time, by the Twitter API link: http://username:[email protected]/statuses/update.xml , and I am looking at how to make my own database to accept updates from iPhone, via a similar API page. It seems a .php page can serve as the...

How to make the UIWebView render the standard version of a webpage instead of automatically being redirected to the mobile version?

The server in some ways redirecting all the request into its mobile version, in which it lacks information, I want to render the page in the standard version using the UIWebView. What would I have to do? I have tried to set the "User-Agent" of the NSURLMutableRequest to Safari but it does not work. Any ideas why? NSMutableURLRequest *mu...

NavigationController not pushing view

I'm accessing a navigation controller from the app delegate and trying to push another view: [appDelegate.myNavigationController pushViewController:self.detailView animated:YES]; but nothing is happening. The above is in myTableView. The app is tabbar based. I added a NavigationController object under the TabbarController object ...

How do you embed the camera display in a view on the iPhone?

How do you show the live camera feed in a subview within our main interface on the iPhone? ...

Rendering hundreds of "block" images -vs- Partially rendering a "map" of blocks

It seems that none of these solutions eliminate the lag associated with rendering images onto the screen (whether from .png's or using CG). There is a 28x16 grid of blocks that are each 16x16 pixels, and at some points in the game, about half of them need to change their image because of a state change. Having each block as a subview of...

How do I query/filter a to-many relationship in Core Data

I have Customer, Event and Address objects in my data model. Both Customer and Address have a one-to-many relationship to Event. I can get the distinct list of addresses for a customer's events for by doing this: NSSet *addressSet = [customer valueForKeyPath:@"events.address"]; For the part of the UI I'm working on now, I need to di...

iphone dev - activity indicator scroll with the table

In a view of my app I subclass tableViewController and has an activity indicator shown up when the table content is loading. I put it in the center of the screen but it scroll with the tableView (I guess the reason is I add it as a subview of the table view). Is there a way that I can keep the activity indicator in the center of the scre...

iPad application UITableView delegate methods are not getting called

Hi, I am using the same technique as i populate my UITableView in iphone while writing my iPad application. Tab Bar Controller >UINavigationController>UITableViewController of type myCustomTable(load From NIB) MyCustomTableViewController NIB and class file implements the delegate methods @interface MyCustomTableViewController : UITable...

High level process of extracting images from a container

Right, this is the problem I have a container (rar,zip) which contains images png's tiffs bmps or jpegs in an order. The file extension isnt zip or rar though but uses the same compression. I want to pull out a list of images contained within the file in the numerical order, then depending on the user decision go to the image selected....