Tag: iphone

Send mail without MFMailComposeViewController

I want to send mail from an iPhone app without showing an MFMailComposeViewController. I also want this mail to be sent from the user’s default Mail account. Is it possible to do this?

How do you calculate the day of the year for a specific date in Objective-C?

This is something I found myself spending hours to figure out and therefore want to share with you. The question was: How do I determine the day of the year for a specific date? e.g. January 15 is the 15th day and December 31 is the 365th day when it’s not leap year.

Why does UINavigationBar steal touch events?

I have a custom UIButton with UILabel added as subview. Button perform given selector only when I touch it about 15points lower of top bound. And when I tap above that area nothing happens. I found out that it hasn’t caused by wrong creation of button and label, because after I shift the button lower […]

Client/Server GKSessions

I have an application that is set up so that if the user selects the device to be a server it creates a GKSession in server mode, and if it selects cient it create a GKSession in client mode. Whats happening at the moment is the server is sending out the data fine, which is […]

What does @synthesize window=_window do?

I understand that @synthesize window; combined with @property ‘auto-creates’ your setters and getters, but I’m not sure exactly what happens when you assign a value like @synthesize searchBar = _searchBar; Does this mean that I can simply use _searchBar instead in my methods rather than say self.searchBar ? Is it to prevent a clash of […]

Strange problem comparing floats in objective-C

At some point in an algorithm I need to compare the float value of a property of a class to a float. So I do this: if (self.scroller.currentValue <= 0.1) { } where currentValue is a float property. However, when I have equality and self.scroller.currentValue = 0.1 the if statement is not fulfilled and the […]

iPhone popup menu like iPad popover?

How can i implement this popup menu in iphone app like a popover in ipad? EDIT: This is the best at moment: https://github.com/runway20/PopoverView

How to create singleton class in objective C

How can I create a singleton class in Objective C?

How do I use CaptiveNetwork to get the current WiFi Hotspot Name

I need to get the name of the currently connected Wi-Fi hotspot, e.g. “BT OpenZone” I have been told it can be done with CaptiveNetwork specifically CNCopyCurrentNetworkInfo My code so far: #import <SystemConfiguration/CaptiveNetwork.h> … // Get the dictionary containing the captive network infomation CFDictionaryRef captiveNtwrkDict = CNCopyCurrentNetworkInfo(kCNNetworkInfoKeySSID); // Get the count of the key value […]

How Do I write a Timer in Objective-C?

I am trying to make a stop watch with NSTimer. I gave the following code: nst_Timer = [NSTimer scheduledTimerWithTimeInterval:0.001 target:self selector:@selector(showTime) userInfo:nil repeats:NO]; and it is not working in milliseconds. It takes more than 1 millisecond.