objective-c

bewildering tableView reloadData crash

For the life of me, I cannot figure this out. Here's the scenario: I have a tableview with a searchbar at the top. I do a search. I tap a search scope button. Do another search. Tap the other search scope button (the one that was selected by default). Do another search. Crash I'm presented with the following: *** -[CALayer retain]:...

Getting reference to the top-most view/window in iOS application.

I'm creating a reusable framework for displaying notifications in an iOS application. I'd like the notification views to be added over the top of everything else in the application, sort of like a UIAlertView. When I init the manager that listens for NSNotification events and adds views in response, I need to get a reference to the top-m...

Strange EXC_BAD_ACCESS error in ObjC

I know this error is relating to memory management. However, I can't work out what is wrong with the management. With the following code: id month = [monthsArray objectAtIndex:indexPath.row]; NSLog(@"%@", [month class]); NSDictionary *dict = [logbookDataController summaryForMonth:month inYear:yearToView]; summaryForMonth:inYe...

What is the proper way to declare a function for use, from a 3rd party class?

I'm trying to utilize a class from the Google Toolbox for Mac libraries, for unescaping HTML text. Specifically, I'm using GTMNSString+HTML.h and GTMNSString+HTML.m. Where I'm trying to escape the text, I'm doing this: NSString *escaped = [ gtm_stringByEscapingForHTML:_item.body ]; But when I try to compile I'm getting an error: 'gt...

Authorization and NSMetadataQuery

Hi, I'm trying to use NSMetadataQuery to read in restricted directories and I've encountered some problems: I followed the apple documentation to acquire privileges but the result of the query is empty (while I know it shouldn't). Here's the code I wrote: AuthorizationRef myAuthorizationRef; OSStatus myStatus = AuthorizationCreate(...

How do I get a formatted NSString from format and va_list?

I'm developing a static library that will be distributed to other developers, who may need debug statements. So I have several levels of logging. In order to avoid constant appearance of if(loggingLevelCurrentlySet >= loggingLevelWantedForThisInstance){ NSLog(@"log this"); } I created a set of logging function wrappers. A simp...

NSURLRequest, why does craigslist return a 404?

Hi there, I'm building my first iPhone app and I'm stymied. I'm trying to build an RSS reader, and I'm trying to use a feed from craigslist. This code, using stackoverflow, returns "Status code: 200": - (void)parseRSSFeed:(NSString *)feed withDelegate:(id)delegate { responseData = [[NSMutableData data] retain]; feed = @"http://stacko...

My Cocoa program won't run on an Intel Core Duo

I am compiling and running my app fine on a new core i5 system. However, when I try to run it on a core duo it doesn't work. At first Mac OS would refuse to run it, but then I turned off "build for active architecture only" in XCode and cleaned and rebuilt the app. Now the app seems like it's starting (the icon does the getting bigger t...

code problem - beginner

Ok here is my code so far: @implementation PtyView - (id)initWithFrame:(NSRect)frame; { if (self = [super initWithFrame: frame]) { [self setFont:[NSFont fontWithName:@"Courier" size:0.0]]; [self startTask]; } return self; } - (void)keyDown:(NSEvent *)event { const char * typein = [[event characters]...

StatusItem menu blocks main thread when it's opened. Workaround?

I've written an app for the Mac that is designed as a status bar item. However, when a user opens its menu from the status bar, the main run loop is blocked until it's closed. Since this app responds to messages on a socket, it's a problem that it can't do anything while the menu is open. I've tried setting the status item from a separa...

Universal iPhone/iPad AppDelegate

Hi everyone, I was wondering if anyone would be able to tell me, starting a new app from scratch, how would I organise having a universal (iPhone/iPad) iOS app. I noticed using the default template with the xCode Beta, it gives you both a shared AppDelegate and subclassed appdelegates for iPhone and iPad. Now, how do you put in the log...

Cocoa dot syntax without variable.

Hey guys, I just wrote a setter and getter method in apples format. There is no variable for it but I noticed I could use the dot syntax. Am I crazy? Does this actually work? Could someone explain exactly what lets you use the dot syntax? // Here is my header definition. Keep in mind there is no class variable or @property for texture. ...

iphone how to get crash log from customers ?

HI, any body knows how i can get crash logs from customers ? instead of manually asking them to sync and go to this directory and this directory and send it. is there any automatic way to do that ?? . to send a crash report to our server by some mean. ...

Objective-C source code

Where can I find the source code for the Objective-C language? Is it open-source or is there an open-sourced implementation of it available? ...

How to make my uiimageview static when i have a scrollview associated with it

Hi to all, I am creating a music application which has more than 12 songs made of 12 tabs .i have added a uiview to my main view and to that uiview i have added imageview which keeps on changing after every 5 seconds. Below that uiview i have added another uiview and imageview and to that my tabs are called dynamically.Scrollview is appl...

Images in iPhone app appear in Simulatpor, but not when compiled to device.

I am learning iPhone development, and have built a simple app that has an image that changes to another image when you tap it. If i build it to the simulator, it works fine, but if i build it to the device the images dont appear. i feel like they aren't being copied across. I have checked they have been named correctly and i have made s...

How to send a uiview to back of another uiview in iphone

Hi all, i am creating a music application where i am using two uiviews in my main uiview . i want that my one view should be send back of another view .Please anyone help me regarding this problem ...

Transparent NavgationBar on iPhone

I'm trying to display transparent UINavigationBar on top of Scrollview. This is actual result of code that I have written... where as I'm expecting view to be displayed like below image, which happens after I slightly scroll the image. Code : - (void) loadView { CGRect pagingScrollViewFrame = [self frameForPagingScrollView];...

Monotouch custom controls, how?

I want to create a custom ui control for my monotouch application. My control consists in a view with 2 labels and 1 image. I need to re-use it more times. Can i develop a custom uiview in monotouch? is possible to use custom controls in Interface Builder? thanks. ...

Objective-C Memory Leaking Understanding Question

I have a program that reads a huge text file (line by line) and does some string operations with each line before writing the line into a database. The program needed more and more memory so I figured that I might need to release the strings that I use. But it did not help. So I have put together the following code to test out what act...