Archive

Archive for November, 2010

Closing an app with iOS 4.0

  • press the home button
  • double tap the home button
  • hold the app icon
  • close the app by clicking the minus button
Categories: iOS

Google Mail Labels

You can edit your labels at the settings here and create sublabels e.g. in the following format:

   [Label]/Sublabel
Categories: Misc

Objective-C Structs

struct ExampleStruct {
   NSString* something;
   NSInteger somethingElse;
   ...
};
// useage:
// struct ExampleStruct Struct;
// Struct.something = @"foo";
// Struct.somethingElse = 2;
// or
//struct ExampleStruct Struct = { @"foo", 2, ... };
Categories: iOS, Objective-C

Android settings for simyo

Internet
Menü > Einstellungen > Wireless > Mobile Netzwerke > Zugangspunkte
Menü > Neuer APN >

Name:   simyo Internet
APN:   internet.eplus.de
Proxy:   Nicht festgelegt
Port:   Nicht festgelegt
Benutzername:    simyo
Kennwort:   simyo
Server:   Nicht festgelegt
MMSC:   Nicht festgelegt
MMS-Proxy:   Nicht festgelegt
MMS-Port:   Nicht festgelegt
MCC:   262
MNC:   03
APN-Typ:   default

Menü > Speichern

MMS
Menü > Einstellungen > Wireless > Mobile Netzwerke > Zugangspunkte
Menü > Neuer APN >

Name:   simyo MMS
APN:   mms.eplus.de
Proxy:   Nicht festgelegt
Port:   Nicht festgelegt
Benutzername:   simyo
Kennwort:   simyo
Server:   Nicht festgelegt
MMSC:   http://mms/eplus
MMS-Proxy:   212.023.097.153
MMS-Port:   5080
MCC:   262
MNC:   03
APN-Typ:   mms

Menü > Speichern

Categories: Android

Iconless iPhone simulator

Does anyone know how this might occur and how to fix it?

iconless iPhone simulator

Categories: iOS, iOS Simulator, Xcode

Location via GPS with iOS

First add the Core Location framework:

  • right click on the “Frameworks” group and go to Add > Existing Frameworks…
  • select the CoreLocation.framework

Then you can use the framework in your app:


#import <CoreLocation/CoreLocation.h>

@interface MyLocation : NSObject <CLLocationManagerDelegate> {
	CLLocationManager *locationManager;
}
@end

#import "MyLocation.h"

@implementation MyLocation

- (id) init {
   if ((self = [super init])) {
      // Custom initialization
      locationManager = [[CLLocationManager alloc] init];
      locationManager.delegate = self;
      locationManager.distanceFilter = kCLDistanceFilterNone;
      locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters;
     [locationManager startUpdatingLocation];
   }
   return self;
}

- (void) locationManager:(CLLocationManager *)manager
   didUpdateToLocation:(CLLocation *)newLocation
   fromLocation:(CLLocation *)oldLocation {

   int degrees = newLocation.coordinate.latitude;
   double decimal = fabs(newLocation.coordinate.latitude - degrees);
   int minutes = decimal * 60;
   double seconds = decimal * 3600 - minutes * 60;
   NSString *lat = [NSString stringWithFormat:@"%d° %d' %1.4f\"", 
                         degrees, minutes, seconds];

   degrees = newLocation.coordinate.longitude;
   decimal = fabs(newLocation.coordinate.longitude - degrees);
   minutes = decimal * 60;
   seconds = decimal * 3600 - minutes * 60;
   NSString *lon = [NSString stringWithFormat:@"%d° %d' %1.4f\"", 
                         degrees, minutes, seconds];
}
@end
Categories: CodeSnippets, iOS, Objective-C

Xcode SVN – Attempted to lock an already-locked dir…

xcode attempted to lock an already-locked dir svn

If you get a message like “attempted to lock an already-locked dir…” while committing your files try to cleanup your project:


cd <root of svn>
svn cleanup
Categories: SCM, Xcode