objective-c

problems rotating UIScrollView with paging

I am having trouble using a UIScrollView on the IPhone when dealing with rotation. I used Apple's PageControl example as a model, but am creating the scrollview myself in a View. 1) The scrollview works as expected when loading in default Portrait, scrolling left to right horizontally 2) Out of the box, when rotating CW and reinitializ...

NSArray release crashes with EXC_BAD_ACCESS

Another puzzler. I have an NSArray (iTours) containing 3 Objects and a retain count of 1. This Array is released in the object dealloc method as follows: - (void)dealloc { NSLog(@"retain count für iTouren: %d", [iTours retainCount]); [iTours release]; // triggers EXC_BAD_ACCESS [super dealloc]; } The console window sh...

How to upload recorded audio file mixed with part of a music file from ipodapp in iphone to webserver?

And is it possible to mix a just a part of a song with a voice from microphone at all? ...

Can't import PyObjC CoreData module when using mod_wsgi with Apache

Just ported a webapp from TurboGears to Django and going through the process of getting a proper server running (i.e. not runserver). Tried going the recommended Apache + mod_wsgi route that the Django docs talk about, but for some reason the thread stalls out with no error message or anything as soon as you try to import CoreData anywh...

NSFetchedResultsController and NSManagedObjectIDResultType crashes

I´m currently working on an ipad app in which I fetch a lot of data with core data. To keep memory profile low I´m setting the requests resultType to NSManagedObjectIDResultType and grabbing objects with the -objectWithID: Method whenever I need real data. Everything works as expected. The problem is when it comes to adding/removing Ob...

cocoa mousedown on a window and mouse up in another

Hello, I am developping a Cocoa application and I have a special need. In my main window, when I mouse down on a certain area, a new window (like a complex tooltip) appears. I want to be able to do: - mouse down on the main window (mouse button stay pressed) - user moves the mouse on the "tooltip" window and mouseup on it. My issue is...

How would i load a xib when device orientation is changed in xcode?

how would i go about loading a new xib when the orientation of the device is changed? i.e. load a landscape oriented xib when the device is turned into landscape orientation and vice-versa with portrait. and how would i go about automatically detecting an orientation change and adjusting from there? ...

UISplitViewController - BarButton Item not shown at start.

Hi. I'm having trouble showing an UISplitViewController programatically. I have two views, an UIView with buttons which when are pressed load's my own custom RootViewController and DetailViewControllers into SplitViewController and hides the menuSubview for showing UISplitViewController. Well, it works well in portratits orientation, ...

How to organize Objective-C UIViewControllers for UINavigationController in code

I have a project with the following: navigationController: usersViewController (UITableViewController) [rootViewController] photoViewController (UIViewController) chatViewController (UIViewController) (It has a tableView as a subview) I'm also using the ZTWebSocket code to make a webSocket connection. I'm choosing to define & connec...

How to clear NSDate milliseconds

I want to keep date/times in a CoreData store with no seconds or milliseconds. (I'm doing some processing to round times off, and stray seconds/milliseconds become a monkey wrench.) It's easy enough to drop the seconds: NSDate *now = [NSDate date]; NSDateComponents *time = [[NSCalendar currentCalendar] compon...

Questions regarding Objective-C private method example

The following is an example of how to create 'private' methods in Objective-C: MyClass.m #import "MyClass.h" #import <stdio.h> @implementation MyClass -(void) publicMethod { printf( "public method\n" ); } @end // private methods @interface MyClass (Private) -(void) privateMethod; @end @implementation MyClass (Private) -(void) pr...

Get the Zip Code of the Current Location - iPhone SDK

Hi, Is there a method or some way to display the zip code of the current location? Maybe through CLLocationManager or through coordinate points (latitude, longitude). Thanks, Kevin ...

Adding a relationship in my data model causes NSFetchRequest to return zero items

I have a simple entity called "Store" built in Xcode's data modeler for use in an iPhone application. I also have a class (Store) associated with it and I've been able to store and retrieve data using CoreData without any problems. Now I realized that I want to have a relationship to another entity (Aisle). There is already a one-to-o...

Application crashes with UITextViewDelegate

Hi, I'm new to iPhone programming and Objective-C and am having some trouble with my UITextView. I have a view with a text view as its subview. I created a separate class which I want to be the delgate of the text view. In my header for this delegate class, I have the statement @interface MessageTextViewDelegate : NSObject UITextVie...

Quick NSArray Question - count

Hello! Does nsarray count return the NUMBER of objects (I.E. the first object would be 1, etc) or does it return the max index of the object (I.E. the first one would be 0); Thanks, Christian Stewart ...

Smart Links in Objective-C

I have an Objective-C application that uses WebKit for rendering and I would like a system to automatically detected the NSRanges of links and create them into the proper HTML anchor links. Currently I use a touchy regex to do this, but I am seeking a more sophisticated-like system that can tell the difference between links like http://w...

creating an infinite stack of UIImageviews in xcode

i am trying to create a stack of UIImageViews in my app where i can indefinitely touch the uiimageview move it around the screen and drop it anywhere and there would still be a representation of the UIImageview in the original location where i could go grab another uiimageview move it and so on.the way i was trying to solve this problem ...

How can I inspect an objective c object?

In ruby, I can .inspect from an object to know the details. How can I do the similar thing in objective c? Thank you. ...

UIDeviceOrientation *orientation = [UIDevice currentDevice].orientation; gets an 'incomplatible types in intialization' error

can anyone tell me why this line would throw an incompatible types error? UIDeviceOrientation *orientation = [UIDevice currentDevice].orientation; ...

Objective-C String-Replace

Hello, I want to replace multiple elements in my string in Objective-C. In PHP you can do this: str_replace(array("itemtoreplace", "anotheritemtoreplace", "yetanotheritemtoreplace"), "replacedValue", $string); However in objective-c the only method I know is NSString replaceOccurancesOfString. Is there any efficient way to replace ...