这是我的头文件
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <PolygonShape.h>
@interface Controller : NSObject {
IBOutlet UIButton *decreaseButton;
IBOutlet UIButton *increaseButton;
IBOutlet UILabel *numberOfSidesLabel;
//IBOutlet PolygonShape *shape;
}
- (IBAction)decrease;
- (IBAction)increase;
@end
Run Code Online (Sandbox Code Playgroud)
这是我的实现文件
#import "Controller.h"
@implementation Controller
- (IBAction)decrease {
//shape.numberOfSides -= 1;
}
- (IBAction)increase {
//shape.numberOfSides += 1;
}
@end
Run Code Online (Sandbox Code Playgroud)
为什么我的#import "Controller.h"线路上出现以下错误?
error: PolygonShape.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)
PolygonShape.h和.m文件与Controller类位于同一项目中,并位于同一目录中.
我有一个字典对象,我正在从中提取数据.该字段应该是一个字符串字段,但有时它包含的所有字符都是一个数字.我使用以下信息获取信息:
NSString *post = [[temp objectAtIndex:i] valueForKey:@"POSTDESCRIPTION"];
Run Code Online (Sandbox Code Playgroud)
所以它进入了一个字符串对象.但是,当我尝试通过以下方式将其分配给单元格的文本时:
cell.textLabel.text = post;
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
'NSInvalidArgumentException', reason: '*** -[NSDecimalNumber isEqualToString:]: unrecognized selector sent to instance 0x4106a80'
2009-10-20 13:33:46.563
Run Code Online (Sandbox Code Playgroud)
我尝试用以下方法进行投射无效:
NSString *post = [[[temp objectAtIndex:i] valueForKey:@"POSTDESCRIPTION"] stringValue];
NSString *post = (NSString *)[[temp objectAtIndex:i] valueForKey:@"POSTDESCRIPTION"];
cell.textLabel.text = [post stringValue];
cell.textLabel.text = (NSSting *)post;
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
由于hidesAccessoryWhenEditing在iPhone 3.0 SDK中已弃用,有什么替代品?你如何获得相同的功能?
我有一些新学生很快就会开始,而我过去一直在做的就是把他们扔到最深处学习ColdFusion.我通常给他们一个非常小的项目,其中包含大多数常见的ColdFusion"部分".是否有更好/更快的方式让他们获得基础知识?什么是伟大的是他们可以通过一两个小时的在线教程.anyboyd知道这是否存在于某处?
我正在寻找在演讲10"性能和线程"中使用的Flickr多线程示例应用程序.他做了一些我想看的事情.我正在寻找的特定文件是ImageLoadingOperation.h和MyTableViewController.m?
有人知道他们是否存在于某处,我只是错过了吗?如果它们不存在,是否有人知道使用NSInvocationOperation并创建类以线程方式加载图像的一些好例子?
我有一个包含两个TableView的笔尖.表视图与我创建的同一个类是UITableViewController的子类.我相信一切都是正确的.但是,当我将UITableView设置为UITableViewController然后运行
[uitableviewcontrollervariablename reloadData];
Run Code Online (Sandbox Code Playgroud)
我首先得到一个警告,该类可能无法响应reloadData.我以为所有UITableViewControllers都有一个reloadData类?
我试图错误地连接这些项目?
使用代码更新: TopicViewController.h
@interface TopicViewController : UIViewController {
NSInteger topicID;
Topic *topic;
IBOutlet ThoughtTableViewController *featured;
}
@property (retain) Topic *topic;
@property (readonly) NSInteger topicID;
@property (retain) IBOutlet ThoughtTableViewController *featured;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil ID:(NSInteger)ID;
@end
Run Code Online (Sandbox Code Playgroud)
TopicViewController.m
@implementation TopicViewController
@synthesize topic;
@synthesize topicID;
@synthesize featured;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil ID:(NSInteger)ID {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
topicID = ID;
}
return self;
}
- (void)dealloc {
[topic release];
[super dealloc];
}
// Implement …Run Code Online (Sandbox Code Playgroud) 这看起来很简单,但我无法使语法正确.我有一个List <>的自定义对象具有不同的属性(例如Name).我想做的是从表单中的所有名称中创建一个字符串:
名1 ||名称2 || NAME3
我想只是string.Join但需要将我的List <>对象放入对象的名称数组中.
我知道这不正确,但有些人喜欢
的string.join(myListofObjects [ "名称"].ToArray的())
我究竟做错了什么?
iphone ×5
objective-c ×5
cs193p ×2
uitableview ×2
arrays ×1
browser ×1
c# ×1
casting ×1
coldfusion ×1
deprecated ×1
import ×1
join ×1
list ×1
nsstring ×1