달력

10

« 2024/10 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
http://crystalclear.musingsfrommars.org/

이쁘네요
사용해보고 싶다...ㅎ
:
Posted by netkorea

strUrl = [strUrl stringByAddingPercentEscapesUsingEncoding:-2147481280];

http://limechat.net/rubycocoa/wiki/?NSStringEncoding

NSStringEncoding

Tiger で使える NSStringEncoding の値を列挙してみました。

1 NSASCIIStringEncoding Western (ASCII) US-ASCII
2 NSNEXTSTEPStringEncoding Western (NextStep) X-NEXTSTEP
3 NSJapaneseEUCStringEncoding Japanese (EUC) EUC-JP
4 NSUTF8StringEncoding Unicode (UTF-8) UTF-8
5 NSISOLatin1StringEncoding Western (ISO Latin 1) ISO-8859-1
6 NSSymbolStringEncoding Symbol (Mac OS) X-MAC-SYMBOL
7 NSNonLossyASCIIStringEncoding Non-lossy ASCII
8 NSShiftJISStringEncoding Japanese (Windows, DOS) CP932
9 NSISOLatin2StringEncoding Central European (ISO Latin 2) ISO-8859-2
10 NSUnicodeStringEncoding Unicode (UTF-16) UTF-16
11 NSWindowsCP1251StringEncoding Cyrillic (Windows) WINDOWS-1251
12 NSWindowsCP1252StringEncoding Western (Windows Latin 1) WINDOWS-1252
13 NSWindowsCP1253StringEncoding Greek (Windows) WINDOWS-1253
14 NSWindowsCP1254StringEncoding Turkish (Windows Latin 5) WINDOWS-1254
15 NSWindowsCP1250StringEncoding Central European (Windows Latin 2) WINDOWS-1250
21 NSISO2022JPStringEncoding Japanese (ISO 2022-JP) ISO-2022-JP
30 NSMacOSRomanStringEncoding Western (Mac OS Roman) MACINTOSH
-1677721344 Unicode (UTF-32LE) UTF-32LE
-1744830208 Unicode (UTF-32BE) UTF-32BE
-1811939072 Unicode (UTF-16LE) UTF-16LE
-1879047936 Unicode (UTF-16BE) UTF-16BE
-1946156800 Unicode (UTF-32) UTF-32
-2147480574 Western (EBCDIC Latin 1) IBM037
-2147481079 Traditional Chinese (Big 5-E)
-2147481080 Ukrainian (KOI8-U) KOI8-U
-2147481082 Traditional Chinese (Big 5 HKSCS) Big5-HKSCS
-2147481083 Simplified Chinese (HZ GB 2312) HZ-GB-2312
-2147481084 Western (Mac Mail) X-MAC-ROMAN-LATIN1
-2147481085 Traditional Chinese (Big 5) BIG5
-2147481086 Cyrillic (KOI8-R) KOI8-R
-2147481087 Japanese (Shift JIS) SHIFT_JIS
-2147481280 Korean (EUC) EUC-KR
-2147481295 Traditional Chinese (EUC) EUC-TW
-2147481296 Simplified Chinese (EUC) EUC-CN
-2147481536 Korean (ISO 2022-KR) ISO-2022-KR
-2147482062 Chinese (GB 18030) GB18030
-2147482063 Chinese (GBK) GBK
-2147482072 Japanese (Shift JIS X0213) Shift_JIS
-2147482360 Vietnamese (Windows) WINDOWS-1258
-2147482361 Baltic Rim (Windows) WINDOWS-1257
-2147482362 Arabic (Windows) WINDOWS-1256
-2147482363 Hebrew (Windows) WINDOWS-1255
-2147482589 Traditional Chinese (Windows DOS), CP950
-2147482590 Korean (Windows DOS), CP949
-2147482591 Simplified Chinese (Windows DOS), CP936
-2147482595 Thai (Windows DOS), CP874
-2147482596 Greek (DOS Greek 2) IBM869
-2147482597 Cyrillic (DOS) CP866
-2147482598 Nordic (DOS)
-2147482599 Arabic (DOS) cp864
-2147482600 Canadian French (DOS)
-2147482601 Hebrew (DOS) DOS-862
-2147482602 Icelandic (DOS) CP861
-2147482603 Portuguese (DOS)
-2147482604 Turkish (DOS) CP857
-2147482605 Cyrillic (DOS)
-2147482606 Central European (DOS Latin 2) CP852
-2147482607 Greek (DOS Greek 1)
-2147482608 Western (DOS Latin 1) CP850
-2147482618 Baltic Rim (DOS) CP775
-2147482619 Greek (DOS) CP737
-2147482624 Latin-US (DOS) CP437
-2147483120 Romanian (ISO Latin 10) ISO-8859-16
-2147483121 Western (ISO Latin 9) ISO-8859-15
-2147483122 Celtic (ISO Latin 8) ISO-8859-14
-2147483123 Baltic Rim (ISO Latin 7) ISO-8859-13
-2147483125 Thai (ISO 8859-11) ISO-8859-11
-2147483126 Nordic (ISO Latin 6) ISO-8859-10
-2147483127 Turkish (ISO Latin 5) ISO-8859-9
-2147483128 Hebrew (ISO 8859-8) ISO-8859-8
-2147483129 Greek (ISO 8859-7) ISO-8859-7
-2147483130 Arabic (ISO 8859-6) ISO-8859-6
-2147483131 Cyrillic (ISO 8859-5) ISO-8859-5
-2147483132 Central European (ISO Latin 4) ISO-8859-4
-2147483133 Western (ISO Latin 3) ISO-8859-3
-2147483412 Inuit (Mac OS)
-2147483496 Cyrillic (Mac OS Ukrainian) X-MAC-UKRAINIAN
-2147483508 Farsi (Mac OS) X-MAC-FARSI
-2147483607 Keyboard Symbols (Mac OS)
-2147483608 Gaelic (Mac OS)
-2147483609 Celtic (Mac OS)
-2147483610 Romanian (Mac OS) X-MAC-ROMANIAN
-2147483611 Icelandic (Mac OS) X-MAC-ICELANDIC
-2147483612 Croatian (Mac OS) X-MAC-CROATIAN
-2147483613 Turkish (Mac OS) X-MAC-TURKISH
-2147483614 Dingbats (Mac OS) X-MAC-DINGBATS
-2147483619 Central European (Mac OS) X-MAC-CENTRALEURROMAN
-2147483622 Tibetan (Mac OS) X-MAC-TIBETAN
-2147483623 Simplified Chinese (Mac OS) X-MAC-SIMP-CHINESE
-2147483627 Thai (Mac OS) X-MAC-THAI
-2147483637 Gujarati (Mac OS) X-MAC-GUJARATI
-2147483638 Gurmukhi (Mac OS) X-MAC-GURMUKHI
-2147483639 Devanagari (Mac OS) X-MAC-DEVANAGARI
-2147483641 Cyrillic (Mac OS) X-MAC-CYRILLIC
-2147483642 Greek (Mac OS) X-MAC-GREEK
-2147483643 Hebrew (Mac OS) X-MAC-HEBREW
-2147483644 Arabic (Mac OS) X-MAC-ARABIC
-2147483645 Korean (Mac OS) X-MAC-KOREAN
-2147483646 Traditional Chinese (Mac OS) X-MAC-TRAD-CHINESE
-2147483647 Japanese (Mac OS) X-MAC-JAPANESE
                                                                                                                                                 
:
Posted by netkorea
property와 synthesize자동 적용
Instance variable to synthesized property (an Xcode user script)

ctrl+command+[ 등록해서 속성 추가한 후 실행하면  property와 synthesize자동 적용,
지금까지 귀찮게 고생한게 억울한 느낌 ?
속성명에 _붙이는것도 반영해줌 미라클

Xcode 화면 꾸미기
Scripted window management in Xcode
myxcodelayout.png
이거 보고 수정한 다른 분꺼
Source: http://pastie.org/671356 
Screenshot: http://img34.imageshack.us/img34/6003/screenshot20091027at831.png


더 자세한 설명은 생략
:
Posted by netkorea

Don’t use UITableViewController. Really.
http://www.skylarcantu.com/blog/2009/09/24/dont-use-uitableviewcontroller-really/

Let’s now cover a few reasons why you won’t want to use a UITableViewController.

  • You can not set the background to a custom image. You can only set the UITableView’s background color property. This stifles the UI possibilities within your application. While using the UIViewController, you get full access to its view property; meaning, you get full access to make the background whatever you want the background to be. If you feel so inclined, go ahead and stick a UIImageView in between your view controller’s view and the UITableView. If you set the UITableView’s background color to clearColor, you’ll see the image shining through!
  • You must have the table sized to be full screen (minus status bar height, navbar height, and tab bar height, if applicable). Why would you want to resize a table? Consider UITableView’s header view. Table headers are nice, really; the problem is that they scroll with your UITableView. Using a UIViewController allows you to use a smaller table and your own non scrolling header above it. It really does make your application look better.
  • Have you ever needed to attach a subview in a UITableViewController? It’s not very pretty. Mostly because a UITableView is a subclass of a UIScrollView. I’m sure you can think of a few reasons not to add subviews to a scrollview. However, adding a subview onto your UIViewController is super easy and recommended. It will not only make the new view a subview of your view controller’s main view, but it ensures that the subview does not scroll along with the table. This is ideal when you want to display a pop up message to your user, briefly display a view over your table that dims the table and makes it inaccessible to touches, or if you simply want to present some options. Take a look at this screenshot from FlowChat, the iPhone irc client by my friends over at brancipater. [/commercial]
:
Posted by netkorea

How to Adjust “Delete” UIButton for UITableView deletion state

- (void)didTransitionToState:(UITableViewCellStateMask)state
{
    [super willTransitionToState:state];
    if (state == UITableViewCellStateShowingDeleteConfirmationMask)
    {
        for (UIView *subview in self.subviews)
        {
            if ([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellDeleteConfirmationControl"])
            {
                UIView *deleteButtonView = (UIView *)[subview.subviews objectAtIndex:0];
                CGRect frame = deleteButtonView.frame;
                frame.origin.x = {NEW X ORIGIN};
                frame.origin.y = {NEW Y ORIGIN};
                deleteButtonView.frame = frame;
            }
         }
    }
}
:
Posted by netkorea
2010. 10. 13. 01:02

NSLog 개선 관련 팁들 개발 - iPhone/개발 Tip2010. 10. 13. 01:02

The Most Useful Objective-C Code I’ve Ever Written « Vincent Gable’s Blog
http://vgable.com/blog/2010/08/19/the-most-useful-objective-c-code-ive-ever-written/

LOG_EXPR(self.window.screen);

self.window.screen = <UIScreen: 0x6d20780; bounds = {{0, 0}, {320, 480}}; mode = <UIScreenMode: 0x6d20c50; size = 320.000000 x 480.000000>>

LOG_EXPR(self.tabBarController.viewControllers);

self.tabBarController.viewControllers = (
“<UINavigationController: 0xcd02e00>”,
“<SavingsViewController: 0xcd05c40>”,
“<SettingsViewController: 0xcd05e90>”
)

:
Posted by netkorea
http://www.cocos2d-iphone.org/forum/topic/5270#post-31812

Hey guys and gals, just let y'all know ahead of time that I have an updated version of my gesture detection class that I am about to release in the next several days.

One, it fixes several bugs.

Two, it is now a singleton, which means you now just call [Gestures sharedGestures] to access the object.

Three, it now uses delegates for when a gesture is detected. To set the delegate to call you do [Gestures sharedGestures].delegate = self or any other object that implements the Gestures Delegates. I will have further instructions on how to set it up when I release it in the coming days.

Four, the delegates are all optional, meaning you do not have to implement all of them if you only want to use one of them. The class automatically checks to see if the delegate method is available before calling it.

Five, it now only stores one array of points for all classes, which means it uses less memory. Also, due to that it now will check against all different types of gestures at the same time and send a delegate response to the ones detected. However, there may be a slight concern if you implement the special circle, x, or square gestures and a sliding gesture, because both may be detected at the same time.

Six, it now how has helper functions for calculating velocity for X and Y for two specified points based on a certain travel time. I implemented this because I found I needed it when using chipmunk physics engine to move objects to certain points within a given time frame. The functions are separated into one for X Velocity and Y Velocity, so you know how much to apply for the cpVect for both x and y. Technically, this should work just fine with box2d also, because it uses the standard acceleration physics formula between two points in a given time.

Finally, here is the updated version of the gesture class:

http://www.vantagetechnic.com/programming/iphone/Gestures.zip

Here are examples on how to use the class functions and delegates:

How to setup the GestureComplete Delegate:

@mojo - Yes - and Metric was kind enough to share the following code with me:

-(void) ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event {
	CGPoint point = [touch locationInView: [touch view]];
	CGPoint converted = [[CCDirector sharedDirector] convertToGL:point];

        //Do something on moved with object

        //Add point to the Gestures point buffer
        [[Gestures sharedGestures] addPoint:converted];
}

This is a very good i just find that the gesture are firing over and over again

and the default values don't seem to work any one fancy sharing there settings for circles squares and x?

these were the only things i tweaked for circle on the iPad:

//anything longer than 2 seconds and...well that's just not fast enough
[Gestures sharedGestures].circle.maximumCircleTime = 2.0;
//being a bit more generous since i only really want circle to work
[Gestures sharedGestures].circle.circleClosureDistanceVariance = 160.0;




:
Posted by netkorea
http://www.cocos2d-iphone.org/forum/topic/7843

I thought I'd go ahead and start a new thread for this...

This is an example project file I put together that handles pinchzoom, scroll, doubletap zoom, etc... feels alot like fieldrunners pinchzoom functionality.

The doubletap-zoom may need some adjustments but overall it works very well. If anyone improves it please share!

http://dl.dropbox.com/u/8990214/pinchzoom.zip

Enjoy

CGSize mapSize;

		self.tileMap = [CCTMXTiledMap tiledMapWithTMXFile:@"TileMap.tmx"];
                self.background = [_tileMap layerNamed:@"Background"];

		self.isTouchEnabled = YES;

                // had to do this because the tilemap is > than the iPhone screen size
		mapSize = _tileMap.contentSize; 

		// create a base layer
		CCColorLayer *base = [CCColorLayer layerWithColor:ccc4(139,139,139,255)];
		base.position = ccp(0,0);
		base.contentSize = mapSize;
		[base addChild:_tileMap];

		[self addChild: base z:0];

		self.anchorPoint = CGPointZero;
		base.anchorPoint = CGPointZero;
		_tileMap.anchorPoint = CGPointZero;

		// attach base layer to PinchZoomLayer
		PinchZoomLayer *pZoom = [PinchZoomLayer initPinchZoom:base];

		// zoom out all the way
		[pZoom scaleToFit];		

		GameSceneHUD *HUD = [GameSceneHUD node];
		HUD.anchorPoint = CGPointZero;
		[self addChild:HUD z:10];

		self.HUD = HUD;



:
Posted by netkorea
http://www.cocos2d-iphone.org/forum/topic/4219

I decided to use a category to work-around this issue. Create a class called "CCMoveTo+RoundedUpdate" and add this code:

CCMoveTo+RoundedUpdate.h

//
//  CCMoveTo+RoundedUpdate.h
//
//	Category to rounded move any object and avoid gaps in tilemap.
//  --> Overrides "update" code from CCIntervalAction.m
//
//  Created by Markus Barta on 09.02.10.
//
#import <Foundation/Foundation.h>
#import "cocos2d.h"
@interface CCMoveTo (RoundedUpdate)
@end

CCMoveTo+RoundedUpdate.m

//
//  CCMoveTo+RoundedUpdate.m
//
//  Created by Markus Barta on 09.02.10.
//
#import "CCMoveTo+RoundedUpdate.h"

@implementation CCMoveTo (RoundedUpdate)
-(void) update: (ccTime) t
{
	//NSLog(@"Using category CCMoveTo+RoundedUpdate for movement -> rounded setPosition!");
	[target setPosition: ccp( round(startPosition.x + delta.x * t ), round(startPosition.y + delta.y * t ) )]; //Setting to a rounded pos avoids gaps in tilemap!
}
@end

Just add those two files to your project and compile. The gaps should be gone :)


:
Posted by netkorea
http://www.cocos2d-iphone.org/forum/topic/7927

That's a fun one... I had to sit down with some graph paper and math and spend a while working it out, I wanted a simple solution that would work in all cases no matter the map size. Hope this saves you some time.

I use multiple ISO map sizes and the touchToXY is in my base map class, it works no matter the map size it will always return the X,Y. Top most tile of the diamond being 0,0.

Here is my solution:

-(CGPoint)touchToXY:(CGPoint)touch map:(CCTMXTiledMap *)_map mapsize:(int)_mapsize
{
	touch = [[CCDirector sharedDirector] convertToGL:touch];
	touch = [_map convertToNodeSpace:touch];
	CGSize ts = [_map tileSize];
	int isoy = (((touch.y/ ts.height) + (touch.x - (_mapsize * ts.width/2)) / ts.width) - _mapsize) *-1;
	int isox = (((touch.y/ ts.height) - (touch.x - (_mapsize * ts.width/2)) / ts.width) -_mapsize) *-1;
	return ccp(isox,isoy);
}

To call it:

Variables you need to define are

<CCTMXTiledMap> = Your Tile Map
<MapWidthInTiles> = How big is the grid.  20 if it's 20x20, 30 if it's 30x30 etc..

Call from your touch code:

CGPoint myTouch = [touch locationInView: [touch view]];
CGPoint isoXY = [self touchToXY:myTouch map:<CCTMXTiledMap> mapsize:<MapWidthInTiles>];
Posted 2 months ago #

:
Posted by netkorea