iphone

Problem in adding data to an array in Objective-C

I am grappling with adding an NSData object to a NSMutable array. The code is executing fine but it is not adding the objects in the array.The code is as follows: NSData * imageData = UIImageJPEGRepresentation(img, 1.0); int i=0; do{ if([[tempArray objectAtIndex:i] isEqual:imageData]) { [tempArray remo...

iPhone dev - viewDidUnload subviews

I'm having a hard time undestand a couple of the methods in UIViewController, but first I'll say what I think they are meant for (ignoring interface builder because I'm not using it): -init: initialize non view-related stuff that won't need to be released in low memory situations (i.e. not objects or objects that can't be recreated ea...

What are the relevant classes / frameworks when I want to write / read stuff to / from disk?

Which classes / frameworks must I look at? I don't want to use 3rd party libs, so just plain old, boring default solutions to read / write text files and stuff like that... Is there something like a File IO framework? ...

@property, ok in this situation?

I am still finding my feet with objective-c and was wondering if its acceptable to use @property on the two objects below. #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface MapViewController : UIViewController <MKMapViewDelegate, CLLocationManagerDelegate> { CLLocationManager *locationManager; IBOutlet MKMapView *goo...

iPhone dev - viewDidLoad and viewDidUnload in programmatically created view?

I read somewhere that in a programmatically created view in a UIViewController, not using Interface Builder, -viewDidLoad and -viewDidUnload should not be used. Is this right? Why? Where would I release subviews that I have retaining properties of? Or should I just not use properties for them? EDIT: Read my comments on Rob Napier's answ...

Does anyone know how to create a tableview that consists of different cell types

I'm trying to create a tableview which contains different types of table cell but I'm stuck. How do I return a different type of cell dependent on the row number in the... (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { function. ...

iPhone UI libraries?

Has any one encountered any open source iPhone UI Libraries that are good to use in projects to replace some of the standard controls with ones that are more customizable? ...

Gray UISearchBar w/matching scope bar programmatically

Hi All, I'm trying to recreate this UISearchBar (as seen in the Table Search example code): All the examples I've seen to do this involve using a xib, however I need to do it programmatically. The problem is changing the tint color also changes the cancel button's tint: Any ideas? ...

Send http request with Chinese words

NSString *urlAddress = @"http://www.test.com/test.jsp?Query=哈囉"; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; NSURLResponse* myURLResponse; NSError* myError; NSData* data = [NSURLConnection sendSynchronousRequest: requestObj returningResponse:&myURLResponse error:& myErr];...

Which are the most noteable things which make working with Core Data different than with MySQL?

One thing I have in mind is, that datasets in Core Data (or lets say: managed objects) have no ID like known from other databases such as MySQL. Also, they're not in a specific guaranteed order. What else makes Core Data much more "special" compared to working with a relational database like MySQL? Besides the whole object graph persist...

Having problems with uploading photos to TwitPic using OAuth in Objective C on the iPhone

I have been working on an iPhone app that has a feature of uploading photos to TwitPic. I have it working with basic authentication. I am trying to get it working with OAuth. I am getting authentication errors. I have studied very carefully the TwitPic documentation. I am authorising the app by displaying a UI Web View and the it re...

uiwebview within uiscrollview

I am having an issue with a uiwebview within a scrollview. In this scrollview, there is a "header" view at top and "bottomview" which is the webview. I am loading the data into the webview using loadHTMLstring method. What I am trying to do is that when I zoom, it should zoom in only on the bottom portion, not the top part. This is v...

UIView animation VS core animation

I'm trying to animate a view sliding into view and bouncing once it hits the side of the screen. A basic example of the slide I'm doing is as follows: // The view is added with a rect making it off screen. [UIView beginAnimations:nil context:NULL]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDuration:0.07]; [UI...

iPhone signal strength

Hello, I know this question has been floated, but there are not any answers. In Objective C, is there a way to return signal strength? Thanks in advance, Rob ...

How can i call NStimer form one viewcontroller from unother viewcontroller?

At first time i call the timer like this in Third viewcontroller timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(targetMethod) userInfo:nil repeats:NO]; Then timer called the targetMethod -(void)targetMethod { First * sVC = [[First alloc] initWithNibName:@"First" bundle:[NSBundle mainBundle]]; [se...

Inactive area after device rotation

Hi all, I don't understand what's wrong in my very simple application with device rotation : I built my view with interface builder. (See screen capture here) I specified <key>UIInterfaceOrientation</key><string>UIInterfaceOrientationLandscapeRight</string> in my info.plist file. I had a (BOOL)shouldAutorotateToInterfaceOrientation:(U...

iphone UIImagePickerController ignoring picture request

Sometimes when I try to call [myController takePicture] on a UIImagePickerController object, I receive this response: UIImagePickerController: ignoring request to take picture; image is already being captured or camera not yet ready. I believe it's not because an image is already being captured because I launch the camera and it fails...

NSNotification for UIMenuControllerWillShowMenuNotification

I am trying to use the NSNotificationCenter to get UIMenuControllerDidShowMenuNotification from a UIWebView. I have the following code in my ViewDidLoad method: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuControllerWillHide:) name:UIMenuControllerWillHideMenuNotification object:nil]; [[NSNotificationCen...

Is there a way to capture HTML5 video events on the iPhone?

I have my standard video tag which is playing fine in Chrome; <video width="x" height="y" src="video.mp4"></video> The video itself plays fine on the iPhone, however, is there no way to listen for events? Any kind of event? I'd like to use the 'ended' event, but even a 'click' or 'play' would be helpful! The standard video.addEventL...

How does CoreLocation locate the device?

More specifically, does CL require the user to have a data connection? Or is it possible to just use the phones service connection? Thanks! ...