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"));


Monday, August 2, 2010

AVCaptureMovieFileOutput

Remelem nem baj, ha ezt ide bemasolom:

Thursday, July 29, 2010

UIApplicationExitsOnSuspend

Ha az app-unk ugysem csinal semmit suspend modban es idegesit, hogy nem lehet egyszeruen kiloni, akkor az info.plist-hez ezt kell hozzaadni: UIApplicationExitsOnSuspend

Wednesday, July 14, 2010

UISplitViewController MasterView mutatasa portrait modban

A SplitView portrait modban automatikusan elrejti a MasterView-t es csak a DetailView-t mutatja, ahogy itt le is irjak:
"When the device is in a landscape orientation, the split view shows both panes. However, in portrait orientations, the split view displays only the second pane, which grows to fill the available space."

Egy nem dokumentalt (private) api hivassal ezt ki lehet kapcsolni:
[splitViewController setHidesMasterViewInPortrait:NO];

Csak igy valoszinuleg nem veszi be az App Store.

Az iPad alkalmazasoknak portrait es landscape modban is mukodniuk kell

iPhone-nal ez nem volt eloiras, de itt mar igen:

New) An application’s interface should support all landscape and portrait orientations. This behavior differs slightly from the iPhone, where running in both portrait and landscape modes is not required. For more information, see “Designing for Multiple Orientations.”

Wednesday, May 26, 2010

OS 4.0 > 3.1.3

Downgrade-elni hivatalosan nem lehet, de ha megis kell akkor igy.

Monday, May 3, 2010

Mike Ash: Dealing with Retain Cycles

Itt van az egesz.

"Apple's memory management guidelines state that when two objects have a parent-child relationship, the parent should retain the child. If the child needs a reference back to the parent, that reference should be an unretained, weak reference. This allows the parent to be deallocated, which can then release its reference to the child, avoiding a cycle."

Saturday, May 1, 2010

Validate Build Product

3.2-ben azokat ellenorzi amiket az App Store Review Team is fog es ahogy Jeff Lamarche is mutatja a Build Options-be kell felvenni.

Friday, April 9, 2010

Renaming an Xcode project or executable.

Tom's Cocoa Blog-rol masoltam ide az egeszet:

Renaming a project in Xcode 3.x

This seems like it ought to be a simple process provided by Xcode but it is not. Here is how to do it.

1. Copy and rename the project folder

2. Inside the new project folder rename the files ending in .pch and .xcodeproj

3. Right click on .xcodeproj file (it is actually a folder) and select show contents. In the contents folder there should be a file ending in .pbxproj. Open This file in you favorite editor and replace all instances of the old project name with the new project name.

4. Delete the build folder

5. Open the Renamed Xcode project and right click (Control click) on the Target from the groups and files list. Select Info to open the properties panel.

6. Click on the build tab the select packaging from the collection pop up menu

7. Change the value in the product name build setting to the new name.

8. Do Build Clean all Targets.

Changing the executable name

1. Open the Xcode project and right click (Control click) on the Target from the groups and files list. Select Info to open the properties panel.

2. Click on the build tab the select packaging from the collection pop up menu

3. Change the value in the product name build setting to the new name.

4. Do Build Clean all Targets.

Friday, April 2, 2010

isToday

Abizern stackoverfow-s valasza alapjan:

BOOL isToday(NSDate *date) {

NSCalendar *calendar = [NSCalendar currentCalendar];

unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;

NSDate *now = [NSDate date];

NSDateComponents *comp1 = [calendar components:unitFlags fromDate:date];

NSDateComponents *comp2 = [calendar components:unitFlags fromDate:now];

return [comp1 day] == [comp2 day] && [comp1 month] == [comp2 month] && [comp1 year] == [comp2 year];

}


Thursday, April 1, 2010

copy + paste > 2 release ugyanazon > EXC_BAD_ACCESS

Arra rajottem, hogy valahol 2 release volt, de azt valamiert nehezen talaltam meg, hogy a custom UITableViewCell dealloc-jaban csinaltam ezt. Igy utolag persze mar tok egyertelmu.

Tuesday, March 30, 2010

Igy kell megkeresni az NSDocumentDirectory-t

innen

Locating Directories as Paths

The following example illustrates how you can use the NSSearchPathForDirectoriesInDomains function to find the current user’s Documents directory:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
if ([paths count] > 0) {
    NSString *userDocumentsPath = [paths objectAtIndex:0];
    // Implementation continues...

NSSearchPathForDirectoriesInDomains simply returns the path of the appropriate directory, it does not guarantee that the directory exists. If you want to perform operations such as writing to the directory, you may have to create it first.

Monday, March 29, 2010

Refresh UITableView UIActivityIndicatorView hasznalataval

Olyasmit akartam csinalni, mint a Mail app-ban, hogy egy refresh gomb megnyomasara elkezdporogni az UIActivityIndicatorView a toolbarban, majd amikor sikerult frissiteni a szerverrol akkor visszakerul a refresh gomb. (A Mail app-ban nem tunik el a refresh gomb, de nalam igen.)

A UIViewController toolBarItems-e egy NSArray amiben a UIView-k vannak. Ugy lehet ezeket egymastol egyenlo tavolsagra tenni, ha beteszunk kozejuk olyan UIBarButtonItem-eket amiket UIBarButtonSystemFlexibleSpace-kent inicializalunk.

Elsore ugy probaltam, hogy refreshButton push-aba akartam meghivni egymas utana toolbar atvaltoztatasat, a szerverrol valo adatlekerest es a toolbar visszavaltoztatasat, ami azert se volt jo megoldas, mert ez leblokkolta volna az alkalmazast es azert sem, mert igy nem valtozott a toobar sem. Ehelyett megvaltoztatom a toolbart es egy masik thread-ben kommunikalok a szerverrel majd frissitem a tableview-t es a toolbart.


DryIcons.com - ingyenes ikonok

Itt.

Icon mellett lathato kis szam (badgeNumber) beallitasa

[[UIApplication sharedApplication] setApplicationIconBandgeNumber:42];

Tuesday, March 2, 2010

UIBarButtonItem title-jenek beallitasa

Ha a initWithBarButtonSystemItem:target:action:-nel inicializaljuk a UIBarButtonItem-et, akkor utana a setTitle nem valtoztatja meg a title-jet, ezert inkabb a initWithTitle:style:target:action:-t kell hasznalni.