objective-c

toggle custom image in a UIBarButtonItem

I've been breaking my head for the past two days searching and trying some of my own solutions. I placed a UIBarButtonItem through IB with an image in the top bar to act as a mute/unmute button . Everything works except the image doesn't change. I used the following code and it compiles but no change if( mute == YES ) { UIImage *unm...

Problem with uploading image (iphone sdk, multipartform-data)

Hi, I need to upload image to custom server. I have code like this: NSString* boundary = @"blablablablabla"; NSString* boundaryString = [NSString stringWithFormat:@"\r\n--%@\r\n", boundary]; NSString* boundaryStringFinal = [NSString stringWithFormat:@"\r\n--%@--\r\n", boundary]; NSMutableData* postData = [NSMutableData dataWithCapacity...

How to handle web-app data sync with iPhone Fetched Results Controller

I'm in the middle of developing a companion iPhone app for an existing web application. To give a brief overview, the iPhone app is a tab bar based application with each tab containing navigation controllers. At the moment the iPhone app is downloading data from the web app in a synchronous mode on the main thread that, of course, ti...

Loading iAds in the BannerView

Hi, Can any one tell me how i can load my required iAds in to the BannerView. Do we have to give some type of URL from which it will load the iAds. Your help will be highly appreciated. Regards Abdul Samad ...

NSURLConnection + MultiPart form from file URL

So I have an application that currently upload images to a web service using a multipart form and I do this pretty simply using an NSMutableRequest and NSURLConnection. The problem I seem to be coming into though is I want to be able to upload a given file without loading it into the program as an NSData object, but simply from the file...

iAds Mechanism to show iAds

Hi, i have made a test application that loads apple test ads. i am wondering how the real time ads will be loaded instead of apple test ads. What is mechanism for loading the real time iAds. Can anybody help me in the regard. Regards abdul Samad ...

Corelocation framework does not produce accurate distances

Hi All, I am developing an application that computes the distance travelled by the person. I am testing it on a iPad (Device-3.2). My iPad is using WiFi to get the current location. The results are highly inaccurate even though i have filtered the values. I don't know if GPS will give me accurate results. I am pasting the entire code be...

Creating Arrays from a plist file in iphone SDK 3.3 and up : objective c

Hello everyone. I have run into this issue and have put some major time into finding the answer. I am somewhat new to objective c but not to programming. Here is my question. I have a plist file with this structure root { A ( {songTitle : contents of song}, {songTitle : contents of song} ), B ( {songTitle ...

reload UIView content from a dynamic UIView

First, sorry for my bad english. I need help to reload a dynamic UIView with an UIViewController. In my UIViewController i have an function to build the View Elements like button,labels or other stuff. CGRect cgRct = CGRectMake(0, 40, 320, 380); //define size and position of view UIView *viewContainer = [[UIView alloc] initWithFrame:...

Iphone UIViewController to UINavigation controller programmatically

Hello, I have been stuck on this for a few days now and it is killing me... In my viewDidLoad event, I am trying to programmatically add a full screen UINavigationController to a subview of my view controller. So far, I have only succeeded in doing two things... 1) Only a grey screen shows up OR 2) I get something that resembles a nav...

Cocoa API - Does it contain a diff api?

I'm wondering if there is a diff API in Cocoa, I've attempted to google it but its not bring back any results that are useful. If there isn't an API for this would it be better to call diff from /usr/bin/ or to write my own diff. All I need it for is text-files with a possibility of branching out into binaries and folders later. Thank...

How to solve the leaks in the following code? ObjectiveC

Hi guys, I getting leak here which is written in the appDelegate.m -(NSMutableArray*)getSalutationList { NSMutableArray *list=[[NSMutableArray alloc]init]; [list addObject:@"Dr."]; [list addObject:@"Mr."]; [list addObject:@"Mrs."]; [list addObject:@"Miss."]; [list addObject:@"Ms."]; return list; //return [...

NavigationController + Toolbar

I am using a NavController, but i enabled the toolbar at the bottom. I also added UIBarButtonItem and on the IB, it shows. It basiclly looks like Navigation Controller Navigation Bar Toolbar Root View Controller Bar Button Item Navigation Item So the Bar Button was added under Root View Controller, and i can see it in ...

How can I confirm that an HTTP POST calls my code?

I'm trying to retrieve data from a POST method, code as follows: -(void)postXMLFeed:(NSString *)XMLStrPost { //NSLog (@"XML Feed3: ", XMLStrPost); NSURL *url = [NSURL URLWithString:@"http://xxx.xxx.x.xxx/stephen/sync_upload.php"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; [request setVa...

.Net developer new to Objective-C. Need some critique and suggestions.

I've created one of my first apps using Objective-C. Being a noob, there's a lot of stuff I want to do, but don't know how to apply it in Objective-C. Please take a look at the method below (which I created from scratch) and tell me what you would do to make it better. Obviously I've duplicated code across 2 UILabels, but I'd like to sim...

How to get AVFrame(ffmpeg) from NSImage/UIImage

I'd like to convert NSImage/UIImage to AVFrame(ffmpeg). I found a example code. http://lists.mplayerhq.hu/pipermail/libav-user/2010-April/004550.html but this code doesn't work. I tried another approach. AVFrame *frame = avcodec_alloc_frame(); int numBytes = avpicture_get_size(PIX_FMT_YUV420P, outputWidth, outputHeight); uint8_...

CoreData: How to sort NSManagedObject by its primary key?

I have one subclass of NSManagedObject like following and stored some instances by NSManagedObjectContext. @interface SomeModelObject : NSManagedObject @property (nonatomic, retain) NSString * text; @end Now, I want to fetch the list sorted by its primary key (created automatically). I've tried NSFetchRequest and got runtime er...

CLDaemonClient: Couldn't initialize process assertion for client

iPhone 3G, OS 4.0: I get this message from the console when I am running a location-based app (CLLocationManager). It was occurring each time the NSTimer fired (every 15 seconds). I removed the NSTimer from the code and it now occurs only once right before the "- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(C...

Is there an Objective-C equivalent to Python urllib and urllib2?

Are there any equivalents in objective-c to the following python urllib2 functions? Request, urlopen, HTTPError, HTTPCookieProRequest, urlopen, HTTPError, HTTPCookieProcessor Also, how would I able to to this and change the method from "get" to "post"? ...

UIView's initWithFrame is not firing.

I have following files. UserSettingsViewController.h, UserSettingsViewController.m, UserSettingsViewController.xib, UserView.h, UserView.m. Class of UserSettingsViewController.xib is set to UserSettingsViewController There is a view in UserSettingsViewController.xib (you can see it in Interface builder's document window), i have set its...