iphone

Fetch DB File From Server and use the SQL C API to work with file at run-time.

I realize that I can't write to the app bundle at runtime. I had originally thought I could simply download a file to the application bundle which would in turn be read by my application. NSURL *url = [NSURL URLWithString:@"http://www.drewcarpenter.info/shopping.db"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [re...

Suppressing line specific XCode compiler warnings

Similar to Ben Gottlieb's question, I have a handful of deprecated calls that are bugging me. Is there a way to suppress warnings by line? For instance: if([[UIApplication sharedApplication] respondsToSelector:@selector(setStatusBarHidden:withAnimation:)]) { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:U...

Returning NSNull from actionForLayer:forKey

If I implement the CALayer delegate method actionForLayer:forKey I can return [NSNull null] to force the CALayer to not animate any changes. Unfortunately, [NSNull null] doesn't implement the CAAction delegate and XCode kicks out the following warning: warning: class 'NSNull' does not implement the 'CAAction' protocol Here is the m...

Multiple computers with a standard iPhone developer program

I have enrolled on the standard iPhone Developer Program and I've successfully created a provisioning profile for my iMac. But I also have a MacBook Pro that I use to work while I'm traveling. But with the standard iPhone Developer Program there seems to be no way to have 2 computers to work, unless I spend time revoking and re-creating/...

iphone: Implement delegate in class

I am trying to call up a modal table view controller using presentModalViewController but I am not sure what to do about the delegate. The following code gives me an error: MyRidesListView *controller = [[MyRidesListView alloc] init]; controller.delegate = self; [self presentModalViewController:controller animated:YES]; [co...

Open PowerPoint in Iphone/Ipad and display it in my application

Hi, I'm trying to write application which will be able to display MS Word docs, MS PowerPoint presentations(ppt). Is there some kind of support for those formats. I know that mail application can open PowerPoint. If there is no support for it what approach should i take ? Thanks in advance. ...

Alternative for didSelectRowAtIndexPath when UITableViewCells are UIResponders?

The cells in my tableview are horizontal UIScrollViews, which I assume is the reason didSelectRowAtIndexPath is not being called. I have my resignFirstResponder call in that method. Does anyone have an easy way for me to fix this? Is there an alternative to didSelectRowAtIndexPath? Or is there a way to get that method to fire? Thanks!...

UIWebView goBack method acts differently on different devices

First Device: 8gb 2nd gen Version: 3.1.3 (7E18) Model: MB528LL Second Device: 32gb 3rd gen Version: 3.1.3 (7E18) Model: MC008LL When I call goBack on the 8gb device, shouldStartLoadWithRequest:navigationType: is called When I call goBack on the 32gb device, shouldStartLoadWithRequest:navigationType: is not called I am not doing...

Optimizing an iphone app for 3G in landscape with opengl, camera, quartz

I have an iphone app that basically uses the camera, an opengl layer, and UIViews (some drawing with Quartz). It runs ok on 3GS, but on the 3G it is unusable. Particularly, when I press a UIButton, it literally takes sometimes 10 seconds to register the press. Shark doesn't do me much good because it crashes when I try to profile even...

Suggestions on implementing an iPad magazine app

I've been tasked with creating a magazine style app for iPad. Ideally it would look a little something like the Zinio app: http://www.zinio.com/ipad/ . This app is effectively a shell, allowing you to sample magazines (eg. read the first few pages) and select them for download. The magazines appear to have some sort of overlay, allowing ...

How to get a reference to a control in the view?

If I have a UIScrollView set up in the view via the Interface Builder, how do I get a reference to it in the ViewController implementation? I want to programmatically add labels to the scroll view. For example, in C# if you have a textbox declared in the UI/form, you can access it by simply using the ID declared for that textbox. It d...

UIScrollView bounce test

How can I test if the scroll view is bouncing? Is there a notification or something when the bounce ends? Thanks in advance! ...

How to create drop shadows programmatically?

In one iPhone app, I'd like to add drop shadows to a few icons dynamically (the angle of the shadow is not fixed). Is there any built-in API for this purpose? If not, how can this be done? Thanks! ...

iphone nsarray problem?

Okay maybe i just need another set of eyes on this, but I have the following lines of code in one of my view controllers. It takes some data from a file, and populates it into an array using "\n" as a separator. I then use that array to make an NSDictionary, which is used to populate a tableview. It's very simple. However it isnt working...

Serialize struct with pointers to NSData

Hey guys, I need to add some kind of archiving functionality to a Objective-C Trie implementation (NDTrie on github), but I have very little experience with C and it's data structures. struct trieNode { NSUInteger key; NSUInteger count, size; id object; __strong struct trieNode ** children; __strong struct trieN...

"out of scope" error when iterating an NSMutableArray

Why am I getting an "out of scope" error whenever I try to access the "url" variable in this loop? for(NSString *url in self.winnerImageURLs) { [mediaItemString appendFormat:@"{\"type\":\"image\",\"src\":\"%@\",\"href\":\"%@\"},", url, url]; } The class of very item in the "self.winnerImageURLs" NSMutableArray comes back a...

Special characters from MySQL database (e.g. curly apostrophes) are mangling my XML

I have a MySQL database of newspaper articles. There's a volume table, an issue table, and an article table. I have a PHP file that generates a property list that is then pulled in and read by an iPhone app. The plist holds each article as a dictionary inside each issue, and each issue as a dictionary inside each volume. The plist doesn'...

Setting the origin to center of the screen instead of the top left screen?(iPhone)

Hi, I am working on an iPhone app and I am trying to make something that has to do with line-circle collision detection. I am using the slope of the line and checking if the coordinates of a circle suffice the equation y = mx + b. But, with the current origin (0,0) at the top left it is a pain to get the slope. Any way I can convert the ...

iphone reload tableView

In the following code, I have determined that everything works, up until [tableView reloadData] i have NSLOGs set up in the table view delegate methods and none of them are getting called. I have other methods doing the same reloadData and it works perfectly. The only difference tha I am awayre of is tha this is in a @catch block. maybe ...

Best way to update badgeValue of UITabBarController from a UIView

Hi everyone, I have a tabBarController set up in the AppDelegate and have a few UIViewControllers with Nav Controllers. In one of the TabBar items, after I have pushed a few UIViews I want to update the badgeValue item of a different TabBar item. Whats the best way to do this? The only way I can really think is a NSNotification and a s...