我正在尝试CoreData在iosApplication中实现,现在我想从Entity获取所有记录MUSTHAFA
My NSManagedObjectedSubClass is MUSTAHFA
Run Code Online (Sandbox Code Playgroud)
MUSTHAFA.m
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@interface MUSTHAFA : NSManagedObject {
@private
}
@property (nonatomic, retain) NSString * FirstName;
@property (nonatomic, retain) NSNumber * Age;
@property (nonatomic, retain) NSString * Location;
@property (nonatomic, retain) NSString * LastName;
@end
#import "MUSTHAFA.h"
@implementation MUSTHAFA
@dynamic FirstName;
@dynamic Age;
@dynamic Location;
@dynamic LastName;
@end
Run Code Online (Sandbox Code Playgroud)
将记录添加到核心数据
-(void)AddRecordToCoreData{
//NSLog(@"______ ADD Core Data Implementaion");
MUSTHAFA *event = (MUSTHAFA *)[NSEntityDescription insertNewObjectForEntityForName:@"MUSTHAFA" inManagedObjectContext:managedObjectContext];
[event setLastName:@"JOHN"];
[event setFirstName:@"JOSE "];
[event …Run Code Online (Sandbox Code Playgroud) core-data objective-c nsmanagedobject nsmanagedobjectcontext ios
@interface URLClass : NSObject
{
id target;
SEL funObj;
}
+ (URLClass *)sharedInstance;
-(void)theBigFunction:(SEL)func :(id)target;
@property (nonatomic,retain) SEL funObj;
#import "URLClass.h"
static URLClass *instance = NULL;
@implementation URLClass
{
NSMutableData *webData;
}
- (id)init
{
if ( self = [super init] )
{
}
return self;
}
+ (URLClass *)sharedInstance
{
@synchronized([URLClass class])
{
if (!instance)
instance = [[super alloc] init];
return instance;
}
return nil;
}
-(void)theBigFunction:(SEL)func :(id)targetObj{
funObj =func;
target=targetObj;
NSURL *URL = [NSURL URLWithString:@"urlString"];
NSURLRequest *request = …Run Code Online (Sandbox Code Playgroud) 当我尝试使用Application Loader上传应用程序时,我收到以下错误:
请任何人帮助我

我刚刚更新到Xcode 4.6到5.1和iOS 7.0到7.1.1现在我的项目显示警告警报视图"OCUnit已弃用项目"项目名称"使用OCUnit进行单元测试,不推荐使用.选择"转换为XCTest"以更新此项目以使用XCTest进行单元测试."

当我提交到应用商店时,它会影响我的应用吗?
如何删除此警告(或)如何更新我的应用程序以使用XCTest进行单元测试.
我怎样才能将CGContextAddArc中的所有像素点到NSMutableArray.or CGContextRef到NSMutable Array
static inline float radians(double degrees)
{
return degrees * PI / 180;
}
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGRect parentViewBounds = self.bounds;
CGFloat x = CGRectGetWidth(parentViewBounds)/2;
CGFloat y = CGRectGetHeight(parentViewBounds)/2;
UIColor *rbg=[UIColor redColor];
CGContextSetFillColor(context, CGColorGetComponents( [rbg CGColor]));
CGContextMoveToPoint(context, x, y);
CGContextAddArc(context, x, y,100,radians(35),radians(105),0);
CGContextClosePath(context);
CGContextFillPath(context);
// here I want to store All points Containing in the Arc to NSMutableArray
NSMutableArray *pointsArray=????
}
Run Code Online (Sandbox Code Playgroud)
图片
我有我的问题UITableViewCellselection.I正在使用 UITableViewCell一个UITextView子视图.在UITextView启用用户交互的情况下,该对象不可编辑,不可滚动.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell=[[[NSBundle mainBundle]loadNibNamed:@"DemoCell" owner:self options:nil]objectAtIndex:0];
cell. accessoryType=UITableViewCellAccessoryDisclosureIndicator;
}
if([distanceArray count]){
UILabel *label1=(UILabel*)[cell viewWithTag:1];
label1.text=[locationNameArray objectAtIndex:[indexPath section]];
label1.textColor=[UIColor blueColor];
UILabel *label2=(UILabel*)[cell viewWithTag:2];
[label2 setText:[distanceArray objectAtIndex:[indexPath section]]];
UITextView *tview=(UITextView*)[cell viewWithTag:3];
[tview setText:[discriptionArray objectAtIndex:[indexPath section]]];
return cell;
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
DetailedLocationVIew *dView=[[DetailedLocationVIew alloc]initWithNibName:@"DetailedLocationVIew" bundle:nil];
[self.navigationController pushViewController:dView animated:YES];
[dView …Run Code Online (Sandbox Code Playgroud) 如何在iOS 7 SDK中获得CGSize价值NSString,只想转换下面的代码行sizeWithAttributes.
CGSize size = [text sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:NSLineBreakByWordWrapping];
Run Code Online (Sandbox Code Playgroud) 我试图从ios应用程序中的核心数据库中删除行但它不起作用,
if (editingStyle == UITableViewCellEditingStyleDelete) {
appDelegate = [[UIApplication sharedApplication] delegate];
NSEntityDescription *entityDesc = [NSEntityDescription entityForName:@"PRODUCTTABLE" inManagedObjectContext:appDelegate.managedObjectContext];
NSFetchRequest *request = [[NSFetchRequest alloc] init];
[request setEntity:entityDesc];
NSError *error;
NSManagedObject *matches = nil;
NSArray *objects = [appDelegate.managedObjectContext executeFetchRequest:request error:&error];
NSLog(@"Array Count....%d",[objects count]);
matches=[objects objectAtIndex:([indexPath row])];
NSLog(@"...%@",[matches valueForKey:@"productID"]);
NSLog(@"...%@",[matches valueForKey:@"pName"]);
NSLog(@"...%@",[matches valueForKey:@"pPrice"]);
NSLog(@"...%@",[matches valueForKey:@"pDate"]);
[appDelegate.managedObjectContext deleteObject:matches];
}
Run Code Online (Sandbox Code Playgroud)
以下代码的o/p:
Array Count....12
...ABC1226
...ABC-005
...599.39
...2012-08-09 05:07:50 +0000
Run Code Online (Sandbox Code Playgroud)
我从相同的NSManagedObject获取核心数据的数据.为什么删除不更新核心数据?
有没有说明如何整合所有样本项目APNS上IPhone,以及如何获得deviceToken?
ios ×7
iphone ×4
objective-c ×3
core-data ×2
xcode ×2
app-store ×1
cgcontextref ×1
cgsize ×1
delegates ×1
drawrect ×1
ios7 ×1
ios7.1 ×1
nsstring ×1
uitableview ×1
uitextview ×1
unit-testing ×1
xctest ×1