objective-c

WebKit, How do I get the contents of the resource?

I've been writing a Mac app to inspect each HTTP request and so I'm using WebView to load the request. The problem is I can't seem to figure out how to get the content of each of the resource item? I'm trying to get the contents for the resource from the WebResourceLoadDelegate method - (void)webView:(WebView *)sender resource:(id)id...

what is the syntax for "or" inside an if statement?

I could probably use multiple else if statements, but is there a simpler and cleaner way to do an if (condition or othercondition..) in objective-c? ...

XPath Text Search/Sibling Selection

This question might be a little specific but the test program im writing uses XPath to find the data i need in HTML. This piece of HTML(found here) is what im trying to parse. <table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="textSm" align="right">1.&nbsp;</td> <!-- Location of the number is here --> ...

what is the difference among sleep() , usleep() & [NSThread sleepForTimeInterval:] ?

Hi all, Can any body explain me what is the difference among sleep() , usleep() & [NSThread sleepForTimeInterval:] ? What is the best condition to use these methods ? ...

closing a panel in a nib file hangs the application

I have a panel in my nib file that opens on clicking menu item in my application After performing some tasks on the panel , when I close the panel my application hangs . Please suggest me the reason for it and any possible solution. When I used separate nib files for my application and panel ,things worked correctly. ...

iPhone Augmented reality with iOS4 obj c + and Monotouch

Hi With the new additions to the OS and the hardware, iPhone apps can now do some serious augmented reality coolness. What are the instant benefots to the obj c crowd? Are there any frameworks to aid in the creation of AR apps for Obj C devs and if so, can they be easily ported to MT with the btouch project? w:// ...

Good IMAP library for a Mac application.

I am looking for a nice library that can talk to GMail from a Mac application. Really, I am thinking about writing a GMail application for the Mac. Thunderbird and Mail.app just don't cut it for me. Anyway, the library should be written in C, C++ or Obj-C or at least have interfaces for those languages. Of course, anything free and/or o...

adding navigation effect to view based application?

Hi I have created View based application, here i need to navigate between views when button pressed. so in first view controller i have created action for button pressed. -(IBAction)loadSecondView:(id)sender { SecondView *sView = [[SecondView alloc]initWithNibName:@"SecondView" bundle:nil]; [self.navigationController pushView...

Free Type font in pdfs on iPhone

Hello guys! Here's my code to create a PDF file from a CGPDFPageRef. + (void)createPDFFromPDFPage:(CGPDFPageRef)page withFilename:(NSString *)filename { CGRect pageRect = CGPDFPageGetBoxRect(page, kCGPDFMediaBox); CFStringRef path = CFStringCreateWithCString (NULL, [filename UTF8String], kCFStringEncodingUTF8); CFURLRef ur...

objective-c error catching

Im new to obj-c and need some help with this code NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; [dateFormatter setDateFormat:@"E, d LLL yyyy HH:mm:ss Z"]; NSDate *date = [dateFormatter dateFromString:currentDate]; the variable date cannot be nil. how can I make it so that date = current time when it'...

iphone - writeToFile not saving new entry into plist

My writeToFile is not saving my data to my .plist. - (IBAction)clickBtnDone:(id) sender { NSLog(@"Done"); if ([txtGroupName.text length] > 0) { [self dismissModalViewControllerAnimated:YES]; NSLog(@"Group Name: %@", txtGroupName.text); NSMutableArray *newDict = [[NSMutableArray alloc] init]; [self.groups setObject:newDict fo...

Getting list/path of songs from iphone's library

Want to create an alarm application, that will play a music file at a specific time. How can i get list of songs from iphone's library. I want to show this list in tableview, user can then select a single file that will be played at sepecified time. Any code sample? ...

menu over slider - iphone getting the x co-ordinate of UISlider Pointer when sliding

Hello ! Everyone. Let me explain. It is ok to set the max & min value for a UISlider control in iPhone. Accordingly slider will work - OK - Good. First, I will give an example of what exactly I want to implement. In iPad comes with Calendar application as a default. Open calendar, at the bottom - you can see day/week/month listing W...

Converting source to binary

I dont want to give my code to my client, i just want to give him binary. How can i create such binary that client can test using XCode and iphone? ...

UIScrollView draws unused part of view

I have a UIScrollView with a custom content view that uses drawRect to display its contents. In my drawRect method I respect the passed CGRect parameter and only draw what's needed. However, each time the drawRect is called it is passed the entire bounds of the view, even if it is several thousand pixels, and I'm worried about performa...

Is there any way to place two UISearchBar in UITableView?

Hi, I have a UITableView with customized UITableViewCells, now i have already placed one UISearchBar to find one of the data in UITableViewCell and it is working fine. Now i want to do search operation for the other data which is placed in UITableViewCell, so is there a way to place another UISearchBar programmatically? ...

NSDateFormatter problem with increased Date

hi, im trying to increase a date and get a formatted output for every month ... it works fine, but the step Dec 2010 to Jan 2011 doesn't work. please have a look at this: NSCalendar *gregorian = [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease]; NSDate *lastDate = [[NSDate alloc] init]; for (int i = 0;...

How to plot nagative values on graph in core plot?

How to plot negative values on graph in core plot. I am able to draw lines with positive decimal values but in case of negative values my graph shows nothing neither on axis nor on graph. Please suggest any examples or any sample code would work. TIA ...

Xcode debugging problem, seems to cache something

Hi, i have a rather odd problem with the Xcode debugger. In my iPhone application project I'm able to debug some of the files but not all, some of them simply won't allow me to view variable values. I first thought of a configuration problem of my project itself, but when I copy my project say from /A/projectdir to /B/projectdir or ren...

Turn NSString into integer

Sorry guys, I'm a noob. I know that some languages support type casting, but when I tried to do that here it failed, miserably. I've got an UITextField with number only pad, so I'm only getting numbers, and I need the output from that in my int, diff. Here's what I tried: NSString *outputNumber = [NSString stringWithFormat:@"%d", [textB...