Tag: ios

Use a Class name stored in a variable to call a Class method?

I’m probably over-thinking this/wasting time trying to avoid a bit of conditional code – so I thought I would ask. I’ve seen some other questions @ this sort of thing but they were using php or some other language. At the most basic, can I do something like this (I know the syntax is wrong): […]

Change Keyboard Color in UISearchBar with apperance

I want to change the color of the keyboard to black, when the user taps on the search textfield. I was trying to achieve it with UITextField *textField = [UITextField appearance]; [textField setKeyboardAppearance:UIKeyboardAppearanceAlert]; but my build fails with this message Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[UISearchBarTextField _UIAppearance_setKeyboardAppearance:]: unrecognized selector sent to instance […]

Customized UIProgressView with rounded corner images

I am having difficulties customizing UIProgressView with two images. I have found plenty of helpful questions on the internet, but my problem is a little different. Maybe in a way that images I am using are rounded on not cornered rectangles; therefore, stretchableImageWithLeftCapWidth method doesn’t seem to help in my case. When I stretch the […]

Get peer IP address and port on OSX in objective-c from NSStream, CFStream or Socket

I have written a server that listens on a specific port for incoming tcp connections. To manage the network connectivity I am using Streams (CFStream/NSStream). When a connection is esthablished I save all the information about this very connection in another instance of a dedicated class which is also set as the delegate for the […]

Crash on Core Data Migration

Some of our users crash on Core Data migration. There are already several questions about “Core Data Migration & crash”, mainly about memory usage and UI response. Migrating large Core Data database crash Out-Of-Memory while doing Core Data migration Core Data causing app to crash while migrating Core Data lightweight migration crash For high memory […]

How do you make an count-up timer in Objective-C?

I have looked everywhere but I cannot find out how to do so. I need a simple timer that can count up in milliseconds and can be stopped. (XCode 3.1, Objective-C, iPhone OS Development)

Number of Months and Days between two NSDates

I would like to calculate the number of months and days between two NSDates. I have the number of days calculating correctly, but how can convert that to months and remainder days? This is what I’m using to calculate total number of days, which is working correctly. – (NSInteger) numberOfDaysUntil { NSDate *fromDate; NSDate *toDate; […]

Lock all screen orientations to portrait except for 1

I’m developing an iOS app that can only be accessed in portrait mode. Except 1 framework (1 out of the 80 screens in my map) that I’m using needs Landscape support. Therefor I had to allow it in my plist. What is the easiest way of making sure all other views are displayed in portrait […]

Issue in viewing sqlite file created by Core Data in iOS 7

I have an issue when am trying to access the database file that is created by core data. The DB file is in Documents folder. I’ve copied this to my desktop and opened it using Firefox plug in. Hello.sqlite file doesn’t contain any rows that I have inserted values using core data. Am running app […]

People Picker with ios 7, and ios 8

This question already has an answer here: ABPeoplePickerNavigationController changes with iOS8? 3 answers