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.

Thursday, November 4, 2010

portrait-landscape video mode

Innen:

Videos on iPhone are recorded on Quicktime format. The Quicktime format always record videos on landscape and insert metadata on the archive with the orientation information (portrait or landscape) on the moment that was recorded.

...the Transformation Matrix that Apple applies to the Quicktime on the video stream property auxMatrix.

class-dump

This is a command-line utility for examining the Objective-C runtime information stored in Mach-O files. It generates declarations for the classes, categories and protocols. This is the same information provided by using 'otool -ov', but presented as normal Objective-C declarations, so it is much more compact and readable.

SBFormattedPhoneNumber > rejection

Tobb helyen leirjak, hogy igy lehet megszerezni a telefonszamot, de ezt ugysem fogjak beengedni az App Store-ba:


CFShow([[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"]);


Oliver Drobnik itt felsorol meg par dolgot, ami ugyan elerheto, de tiltott (UICoverFlowLayer, UIDevice setOrientation, UIAlertView addTextFieldWithValue, UIProgressHUD)

Wednesday, October 20, 2010

Brent Simmons: Demo code for playing a movie on iOS 4 using AVFoundation

NGMoviePlayer Brent Simmonstol.

SpeedLimit

SpeedLimit is a Leopard preference pane for limiting your network bandwidth to one of a couple different speeds — 768k DSL, Edge, 3G, and Dialup. This is really handy for testing your iPhone app under normal Edge network conditions in the iPhone Simulator.

Simulator forgatasnak lelassitasa

iPhone Simulator-ban Hardware/Simulate Hardware Keyboard bekapcsolasa majd 3-szor a Shift. Ezek utan lassabban fog forogni a simulator.

Thursday, October 14, 2010

Tab Bar + Action Sheet

Ha egy UITabBarController valamelyik View-jan akarunk egy UIActionSheet-et mutatni, akkor azt a TabBar-ra kell tenni es nem az eppen hasznalt View-ra, kulonben a TabBar-ra eso resze az Action Sheet-nek nek kapja meg a touch eventeket es igy a legalso gombnak (pedaul Cancel) csak a felso kicsi resze fogja erzekelni a nyomkodast.

Friday, September 10, 2010

Async kep betoltes UITableViewCell-be

Itt van az Apple peldakodja:
This sample demonstrates a multi-stage approach to loading and displaying a UITableView. It begins by loading the relevant text from an RSS feed so the table can load as quickly as possible, and then downloads the images for each row asynchronously so the UI is more responsive

vagy

Monday, August 23, 2010

Bottom Bar elrejtese amikor betoltunk egy uj View-t.

Ha egy navigation controller-ben van mondjuk alul egy Tab Bar es azt el szeretnenk rejteni egy View-n, akkor:

[myView setHidesBottomBarWhenPushed:YES];
[[self navigationController] pushViewController:myView animated:YES];

Wednesday, August 11, 2010

Josh Highland: Don't use NSLog anymore!

Azt irja, hogy nem engedik be az app store-ba azokat az appokat amikben van NSLog.

Helyette ezt javasolja:

add the following lines to the Prefix.pch file:

#define DEBUG_MODE
#ifdef DEBUG_MODE
#define DebugLog( s, ... ) NSLog( @"<%@:(%d)> %@", [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
#else
#define DebugLog( s, ... )
#endif

In your code, replace “NSLog” with “DebugLog”. THATS IT!
DebugLog adds some new functionality to NSLog. It will now output the file name and line number of the Debug statement.
The best part of this is that its very easy to disable when its time to create a release build of your code. Simple comment out the “#define DEBUG_MODE” line im the “_Prefix.pch” file.

BOOL logolasa

NSLog(@"BOOL = %@\n", (boolVar ? @"YES" : @"NO"));