我想知道如何访问MPMediaItem的原始数据.
有任何想法吗?
在我的应用程序中,我使用自定义NIB来加载我的UITableViewCells.设置了NIB的文件所有者,因此该类是我的视图控制器.然后我将UITableViewCell链接到我放在头文件中的IBOutlet.这一切都很好,直到突然它停止工作,并得到这个错误:
uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (UITableViewCellContentView)'
Run Code Online (Sandbox Code Playgroud)
我已将此异常跟踪到[NSBundle loadNibNamed:owner:options:]
static NSString *CellIdentifier = @"SubjectCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"SubjectCell" owner:self options:NULL];
cell = customSubjectCell;
Run Code Online (Sandbox Code Playgroud)
我在两个设备和模拟器上尝试了这个,但都得到了同样的错误.我今天下载了新的SDK,我认为这可能导致了这个问题.
请注意:
这个问题已经过时,下面的修复是一个临时修复.Apple已修复其SDK,因此如果您拥有最新版本的SDK,则不适用于您.
我创建了一个应用程序,从Web服务获取一组地址,我想映射它们.我知道Apple在MapKit中留下了这个,包括只有一个反向Geocoder.我想知道解决这个问题的最佳方法是什么.网络服务?Google Maps API(API密钥如何工作?)?CloudMade?
您对哪种服务最快,最容易使用,哪种服务最便宜(希望免费)有什么看法?
当我开始我的通用应用程序时,我认为一个目标选项太多了,所以我选择了单独的目标.我通过制作应用程序的iPad部分实现了一半,制作通用应用程序会更容易.问题是,我不能使用Apple的选项将我的iPhone目标转换为Universal,因为已经有单独的目标.有没有一种解决方法可以让我将我的iPhone目标升级到Universal?
我想在带有阴影的UITextField中绘制文本.为了做到这一点,我已经将UITextField子类化,并实现了drawTextInRect:如下方法:
- (void)drawTextInRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
// Create shadow color
float colorValues[] = {0.21875, 0.21875, 0.21875, 1.0};
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGColorRef shadowColor = CGColorCreate(colorSpace, colorValues);
CGColorSpaceRelease(colorSpace);
// Create shadow
CGSize shadowOffset = CGSizeMake(2, 2);
CGContextSetShadowWithColor(context, shadowOffset, 0, shadowColor);
CGColorRelease(shadowColor);
// Render text
[super drawTextInRect:rect];
}
Run Code Online (Sandbox Code Playgroud)
这适用于文本字段未编辑时,但编辑开始后,阴影消失.有什么我想念的吗?
iphone ×4
cocoa-touch ×1
debugging ×1
geocoding ×1
ios ×1
ipad ×1
mkmapview ×1
mpmediaitem ×1
objective-c ×1
uikit ×1
uitableview ×1
xcode ×1