Tuesday, January 18, 2011

NSStringFromCGRect

Ha CGPoint-ot akarok logolni, akkor:
NSLog(@"%@", NSStringFromCGPoint(cgPoint));
Ha meg CGRect-et akkor:
NSLog(@"%@", NSStringFromCGRect(cgRect));

Monday, January 17, 2011

1 touch vagy tobb

Mashogy kellett lekezelni a sima touch-ot a UIView-n es mashogy a dupla touch-ot. Itt a megoldas (innen):
switch (tapCount) {
case 1:
[self performSelector:@selector(singleTapMethod) withObject:nil afterDelay:.4];
break;
case 2:
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(singleTapMethod) object:nil];
[self performSelector:@selector(doubleTapMethod) withObject:nil afterDelay:.4];
break;
case 3:
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(doubleTapMethod) object:nil];
[self performSelector:@selector(tripleTapMethod) withObject:nil afterDelay:.4];
break;
case 4:
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(tripleTapMethod) object:nil];
[self quadrupleTap];
break;
default:
break;
}
Ami persze a touchesEnded:withEvent-be megy.

Monday, January 10, 2011

AVCaptureConnection orientation

A lenyeg, hogy az AVCaptureConnection-on kell beallitani a videoOrientation-t es nem az AVCaptureSession-on vagy az AVCaptureDevice-on.

Valahogy igy:
for(int i = 0; i < [[captureOutput connections] count]; i++) {
AVCaptureConnection *captureConnection = [[captureOutput connections] objectAtIndex:i];
if([captureConnection isVideoOrientationSupported]) {
[captureConnection setVideoOrientation:[[UIDevice currentDevice] orientation]];
}
}

Fontos viszont, hogy AVCaptureVideoDataOutput connection-jan nem lehet videoOrientation-t (es videoMirrored-et) allitani.

Monday, January 3, 2011

Cocoa Samurai: Objective-C Memory Management & Garbage Collection

Itt van.

Unable to load symbols for... DeviceSupport

Itt talaltam meg a megoldast.
Az volt a baj, hogy /Developer/Platforms/iPhoneOS.platform/DeviceSupport-ban volt egy 4.2.1a is a 4.2.1 mellett. Mindkettot kitoroltem es az xcode ujrainditasa majd a device csatolas utan lehuzta maganak ami kell. Valoszinuleg korabban egy beta-val probalkozhattam ami bekavart.

Wednesday, December 8, 2010

popViewController landscape modban fentrol lefele

Az volt a baj, hogy csak a UINavigatonController-ben adott vissza a shouldAutorotateToInterfaceOrientation YES-t. Igy ugyan a pushViewController-rel megnyitott ViewControllerek is forogtak, de ha azokorol visszaleptem (popViewControllerAnimated) landscape modban, akkor nem rendesen jobbra csuszott ki a ViewController, hanem fentrol lefele.

Az a megoldas, hogy nem eleg a UINavigationControlleren megadni a shouldAutorotateToInterfaceOrientation-t, hanem a tobbi ViewCotrolleren is meg kell ezt tenni. (Legalabbis azokon, amikre vissza fougunk lepni popViewControllerAnimated segitsegevel.)

Monday, December 6, 2010

UITextView font allitasa Interface Builder-ben

A Text View attributes-ban nincs benne, de a cmd+T elohozza.