トップ
新規
一覧
単語検索
最終更新
ヘルプ
ログイン
アールメカブ
iPhone_SDK
をテンプレートにして作成
開始行:
[[Programming]]
iPhone SDK メモ
スタンフォード大で [[iPhone 開発講座とコード:http://www.a...
結局,&htmlinsert(amazontext,asin=4797352418,text=iPhone ...
#contents
* UITableVie のフォントの変更 2009 04 08 [#h2fc71a0]
UIFont *font = [UIFont fontWithName:@"HiraKakuProN-W3" s...
cell.font = font;
ちなみに iPhone に入っているフォントは
American Typewriter
* AmericanTypewriter
* AmericanTypewriter-Bold
AppleGothic
* AppleGothic
Arial
* ArialMT
* Arial-BoldMT
* Arial-ItalicMT
* Arial-BoldItalicMT
Arial Rounded MT Bold
* ArialRoundedMTBold
Arial Unicode MS
* ArialUnicodeMS
Courier
* Courier
* Courier-Bold
* Courier-Oblique
* Courier-BoldOblique
Courier New
* CourierNewPSMT
* CourierNewPS-BoldMT
* CourierNewPS-ItalicMT
* CourierNewPS-BoldItalicMT
DB LCD Temp
* DBLCDTEmpBlack
Georgia
* Georgia
* Georgia-Bold
* Georgia-Italic
* Georgia-BoldItalic
Helvetica
* Helvetica
* Helvetica-Bold
* Helvetica-Oblique
* Helvetica-BoldOblique
Helvetica Neue
* HelveticaNeue
* HelveticaNeue-Bold
Hiragino Kaku Gothic ProN W3
* HiraKakuProN-W3
Hiragino Kaku Gothic ProN W6
* HiraKakuProN-W6
Marker Felt
* MarkerFelt-Thin
STHeiti J
* STHeitiJ-Light
* STHeitiJ-Medium
STHeiti K
* STHeitiK-Light
* STHeitiK-Medium
STHeiti SC
* STHeitiSC-Light
* STHeitiSC-Medium
STHeiti TC
* STHeitiTC-Light
* STHeitiTC-Medium
Times New Roman
* TimesNewRomanPSMT
* TimesNewRomanPS-BoldMT
* TimesNewRomanPS-ItalicMT
* TimesNewRomanPS-BoldItalicMT
Trebuchet MS
* TrebuchetMS
* TrebuchetMS-Bold
* TrebuchetMS-Italic
* TrebuchetMS-BoldItalic
Verdana
* Verdana
* Verdana-Bold
* Verdana-Italic
* Verdana-BoldItalic
Zapfino
* Zapfino
UI ロックスクリーン用に
* LockClock-Light
電話のダイヤル用に
* PhonepadTwo
* テーブルのグループ化と配列 [#lc850e3e]
return [[ array objectAtIndex:section] count]
cex.text = [[ array objectAtIndex:indexPath.section]
objectAtIndex:indexPath.row]
return cell;
でいけるだろう。
[[こういう方法:http://icodeblog.com/2008/08/08/iphone-pro...
* 文字列から改行記号を取る. [#m0c7d174]
[[componentsSeparatedByString:http://www.oomori.com/cocoa...
string = [[string componentsSeparatedByString:@"\n"]
objectAtIndex:0];
ただし "\n" は Macintoshではoptions キーを押しながら円マ...
* intValueのエラー処理 [#h2020773]
失敗すると FALSE が返ってくる.
if([ @"" intValue] == TRUE)
下の
[[エラー処理:http://www.gnu-darwin.org/www001/ports-1.5a-...
int syntaxType = [anObject intValue];
if (syntaxType == -1) {
// エラー。例外を発生させる。
[self release];
[NSException
raise:NSInvalidUnarchiveOperationException format:
@"fail to decode"];
}
で、うまくいくかと思いきや。いかぬことがある。
* UITableViewにチェックを入れる。 [#mbfab8fe]
[[さまざまな情報:http://developer.apple.com/iphone/librar...
と思ったが,うまくいかないので,チェックしたセクションと...
>
Now i have another problem, when i select one and i scrol...
A bit strange.
<
>
You must be using a reuseIdentifier. When you go to retur...
<
- (NSIndexPath *)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SeismicXMLAppDelegate *appDelegate =
(SeismicXMLAppDelegate *)[[UIApplication sharedApplicat...
delegate];
[appDelegate showEarthquakeInfo:
[(TableViewCell *)[tableView
cellForRowAtIndexPath:indexPath] quake]];
[[tableView cellForRowAtIndexPath: oldIndexPath]
setAccessoryType:UITableViewCellAccessory...
[[tableView cellForRowAtIndexPath: indexPath]
setAccessoryType:UITableViewCellAccessoryC...
oldIndexPath = indexPath;
return nil;
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
TableViewCell *cell = (TableViewCell *)[tableView
dequeueReusableCellWithIdentifier:MyIdenti...
if(indexPath == oldIndexPath){
cell.accessoryType =
UITableViewCellAccessoryCheckmark;
}else{
cell.accessoryType = UITableViewCellAccessoryNone;
}
if (cell == nil) {
cell = [[[TableViewCell alloc]
initWithFrame:CGRectZero reuseIdentifier:MyIde...
autorelease];
}
// Set up the cell.
SeismicXMLAppDelegate *appDelegate =
(SeismicXMLAppDelegate *)[[UIApplication sharedApplicati...
delegate];
// If the RSS feed isn't accessible (which could happ...
the network isn't available), show an informative
// message in the first row of the table.
if ([appDelegate isDataSourceAvailable] == NO) {
cell = [[[UITableViewCell alloc] initWithFrame:
CGRectZero reuseIdentifier:@"DefaultTableViewCe...
autorelease];
cell.text = NSLocalizedString(@"RSS Host Not Avai...
@"RSS Host Not Available message");
cell.textColor = [UIColor colorWithWhite:0.5
alpha:0.5];
cell.accessoryType = UITableViewCellAccessoryNone;
return cell;
}
Earthquake *quakeForRow = [appDelegate
objectInListAtIndex:indexPath.row];
[cell setQuake:quakeForRow];
return cell;
}
- [[あるいは:http://gist.github.com/raw/68574/28fef56d2f1...
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *SelectionListCellIdentifier =
@"SelectionListCellIdentifier";
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:SelectionListCellId...
if (cell == nil) {
cell = [[[UITableViewCell alloc]
initWithFrame:CGRectZero
reuseIdentifier:SelectionListCellIdentifier] auto...
}
NSUInteger row = [indexPath row];
NSUInteger oldRow = [lastIndexPath row];
cell.text = [list objectAtIndex:row];
cell.accessoryType = (row == oldRow && lastIndexPath !=
nil) ? UITableViewCellAccessoryCheckmark :
UITableViewCellAccessoryNone;
return cell;
}
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPat...
int newRow = [indexPath row];
int oldRow = [lastIndexPath row];
if (newRow != oldRow) {
UITableViewCell *newCell = [tableView
cellForRowAtIndexPath:indexPath];
newCell.accessoryType =
UITableViewCellAccessoryCheckmark;
UITableViewCell *oldCell = [tableView
cellForRowAtIndexPath: lastIndexPath...
oldCell.accessoryType =
UITableViewCellAccessoryNone;
lastIndexPath = indexPath;
}
[tableView deselectRowAtIndexPath:indexPath
animated:YES];
}
終了行:
[[Programming]]
iPhone SDK メモ
スタンフォード大で [[iPhone 開発講座とコード:http://www.a...
結局,&htmlinsert(amazontext,asin=4797352418,text=iPhone ...
#contents
* UITableVie のフォントの変更 2009 04 08 [#h2fc71a0]
UIFont *font = [UIFont fontWithName:@"HiraKakuProN-W3" s...
cell.font = font;
ちなみに iPhone に入っているフォントは
American Typewriter
* AmericanTypewriter
* AmericanTypewriter-Bold
AppleGothic
* AppleGothic
Arial
* ArialMT
* Arial-BoldMT
* Arial-ItalicMT
* Arial-BoldItalicMT
Arial Rounded MT Bold
* ArialRoundedMTBold
Arial Unicode MS
* ArialUnicodeMS
Courier
* Courier
* Courier-Bold
* Courier-Oblique
* Courier-BoldOblique
Courier New
* CourierNewPSMT
* CourierNewPS-BoldMT
* CourierNewPS-ItalicMT
* CourierNewPS-BoldItalicMT
DB LCD Temp
* DBLCDTEmpBlack
Georgia
* Georgia
* Georgia-Bold
* Georgia-Italic
* Georgia-BoldItalic
Helvetica
* Helvetica
* Helvetica-Bold
* Helvetica-Oblique
* Helvetica-BoldOblique
Helvetica Neue
* HelveticaNeue
* HelveticaNeue-Bold
Hiragino Kaku Gothic ProN W3
* HiraKakuProN-W3
Hiragino Kaku Gothic ProN W6
* HiraKakuProN-W6
Marker Felt
* MarkerFelt-Thin
STHeiti J
* STHeitiJ-Light
* STHeitiJ-Medium
STHeiti K
* STHeitiK-Light
* STHeitiK-Medium
STHeiti SC
* STHeitiSC-Light
* STHeitiSC-Medium
STHeiti TC
* STHeitiTC-Light
* STHeitiTC-Medium
Times New Roman
* TimesNewRomanPSMT
* TimesNewRomanPS-BoldMT
* TimesNewRomanPS-ItalicMT
* TimesNewRomanPS-BoldItalicMT
Trebuchet MS
* TrebuchetMS
* TrebuchetMS-Bold
* TrebuchetMS-Italic
* TrebuchetMS-BoldItalic
Verdana
* Verdana
* Verdana-Bold
* Verdana-Italic
* Verdana-BoldItalic
Zapfino
* Zapfino
UI ロックスクリーン用に
* LockClock-Light
電話のダイヤル用に
* PhonepadTwo
* テーブルのグループ化と配列 [#lc850e3e]
return [[ array objectAtIndex:section] count]
cex.text = [[ array objectAtIndex:indexPath.section]
objectAtIndex:indexPath.row]
return cell;
でいけるだろう。
[[こういう方法:http://icodeblog.com/2008/08/08/iphone-pro...
* 文字列から改行記号を取る. [#m0c7d174]
[[componentsSeparatedByString:http://www.oomori.com/cocoa...
string = [[string componentsSeparatedByString:@"\n"]
objectAtIndex:0];
ただし "\n" は Macintoshではoptions キーを押しながら円マ...
* intValueのエラー処理 [#h2020773]
失敗すると FALSE が返ってくる.
if([ @"" intValue] == TRUE)
下の
[[エラー処理:http://www.gnu-darwin.org/www001/ports-1.5a-...
int syntaxType = [anObject intValue];
if (syntaxType == -1) {
// エラー。例外を発生させる。
[self release];
[NSException
raise:NSInvalidUnarchiveOperationException format:
@"fail to decode"];
}
で、うまくいくかと思いきや。いかぬことがある。
* UITableViewにチェックを入れる。 [#mbfab8fe]
[[さまざまな情報:http://developer.apple.com/iphone/librar...
と思ったが,うまくいかないので,チェックしたセクションと...
>
Now i have another problem, when i select one and i scrol...
A bit strange.
<
>
You must be using a reuseIdentifier. When you go to retur...
<
- (NSIndexPath *)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SeismicXMLAppDelegate *appDelegate =
(SeismicXMLAppDelegate *)[[UIApplication sharedApplicat...
delegate];
[appDelegate showEarthquakeInfo:
[(TableViewCell *)[tableView
cellForRowAtIndexPath:indexPath] quake]];
[[tableView cellForRowAtIndexPath: oldIndexPath]
setAccessoryType:UITableViewCellAccessory...
[[tableView cellForRowAtIndexPath: indexPath]
setAccessoryType:UITableViewCellAccessoryC...
oldIndexPath = indexPath;
return nil;
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
TableViewCell *cell = (TableViewCell *)[tableView
dequeueReusableCellWithIdentifier:MyIdenti...
if(indexPath == oldIndexPath){
cell.accessoryType =
UITableViewCellAccessoryCheckmark;
}else{
cell.accessoryType = UITableViewCellAccessoryNone;
}
if (cell == nil) {
cell = [[[TableViewCell alloc]
initWithFrame:CGRectZero reuseIdentifier:MyIde...
autorelease];
}
// Set up the cell.
SeismicXMLAppDelegate *appDelegate =
(SeismicXMLAppDelegate *)[[UIApplication sharedApplicati...
delegate];
// If the RSS feed isn't accessible (which could happ...
the network isn't available), show an informative
// message in the first row of the table.
if ([appDelegate isDataSourceAvailable] == NO) {
cell = [[[UITableViewCell alloc] initWithFrame:
CGRectZero reuseIdentifier:@"DefaultTableViewCe...
autorelease];
cell.text = NSLocalizedString(@"RSS Host Not Avai...
@"RSS Host Not Available message");
cell.textColor = [UIColor colorWithWhite:0.5
alpha:0.5];
cell.accessoryType = UITableViewCellAccessoryNone;
return cell;
}
Earthquake *quakeForRow = [appDelegate
objectInListAtIndex:indexPath.row];
[cell setQuake:quakeForRow];
return cell;
}
- [[あるいは:http://gist.github.com/raw/68574/28fef56d2f1...
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *SelectionListCellIdentifier =
@"SelectionListCellIdentifier";
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:SelectionListCellId...
if (cell == nil) {
cell = [[[UITableViewCell alloc]
initWithFrame:CGRectZero
reuseIdentifier:SelectionListCellIdentifier] auto...
}
NSUInteger row = [indexPath row];
NSUInteger oldRow = [lastIndexPath row];
cell.text = [list objectAtIndex:row];
cell.accessoryType = (row == oldRow && lastIndexPath !=
nil) ? UITableViewCellAccessoryCheckmark :
UITableViewCellAccessoryNone;
return cell;
}
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPat...
int newRow = [indexPath row];
int oldRow = [lastIndexPath row];
if (newRow != oldRow) {
UITableViewCell *newCell = [tableView
cellForRowAtIndexPath:indexPath];
newCell.accessoryType =
UITableViewCellAccessoryCheckmark;
UITableViewCell *oldCell = [tableView
cellForRowAtIndexPath: lastIndexPath...
oldCell.accessoryType =
UITableViewCellAccessoryNone;
lastIndexPath = indexPath;
}
[tableView deselectRowAtIndexPath:indexPath
animated:YES];
}
ページ名: