有人告诉我UITableViewDelegate和UITableViewDatasource之间的区别吗?
我有一个包含此代码的make文件:
all: main.o Etudiant.o
gcc -lobjc -o program main.o Etudiant.o
main.o:main.m Etudiant.h
gcc -c main.m
Etudiant.o:Etudiant.m Etudiant.h
gcc -c Etudiant.m
Run Code Online (Sandbox Code Playgroud)
当我在shell命令中写这个:
$make
Run Code Online (Sandbox Code Playgroud)
我懂了:
make: **** No targets specified and no makefile found. Stop.
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
如何UILongPressGesture向对象发送消息?
我知道如何发送触摸,但不是手势.例如,如果我想发送一个我可以使用的触摸:
[button sendActionsForControlEvents: UIControlEventTouchUpInside];
Run Code Online (Sandbox Code Playgroud)
按钮会收到"内部修饰".我需要用长按手势做同样的事情.
想想自动UI测试.调用与手势相关联的选择器不会有意义地测试任何东西.
我正在开发一个程序(在C#中)来识别来自用户的语音命令并在PC中执行,即用户说"开始菜单"并且PC打开开始菜单.
我找到了一个很酷的库:SpeechRecognitionEngine用于语音识别,问题是我需要识别西班牙语,有没有办法改变语言?
我从数据存储中取出一些对象,但结果并不是我所期待的.我是CoreData的新手,但我相当肯定这应该有用.我错过了什么?
请注意,User是一个有效的托管对象,我将其头文件包含在此代码中,并且该UserID是该类的有效属性.
NSFetchRequest *requestLocal = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"User" inManagedObjectContext:messageManagedObjectContext];
[requestLocal setEntity:entity];
// Set the predicate
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY UserID IN %@", userList];
[requestLocal setPredicate:predicate];
// Set the sorting
... sorting details removed but exist and are fine ...
// Request the data
NSArray *fetchResults = [messageManagedObjectContext executeFetchRequest:requestLocal error:&error];
[requestLocal release];
for (int i; i < [fetchResults count]; i++) {
[fetchResults objectAtIndex:i].UserID = ...<----HERE
}
Run Code Online (Sandbox Code Playgroud)
fetchResults不是User对象的数组吗?不会[fetchResults objectAtIndex:i]成为User对象吗?为什么在构建" 非结构或联合的成员'UserID'请求时"会出错?
对不起,如果这是一个基本错误,我显然缺少一些基本概念.我做了大量的搜索,看起来应该是正确的.(我也试过快速枚举,但它抱怨fetchResults项目不是有效的Objective C对象,我认为实际上是同样的错误.)
当我使用自定义注释时,我无法看到蓝色当前位置点
- (MKAnnotationView *) mapView:(MKMapView *) mapView viewForAnnotation:(id<MKAnnotation> ) annotation {
MKAnnotationView *customAnnotationView=[[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil] autorelease];
UIImage *pinImage = [UIImage imageNamed:@"ann.png"];
[customAnnotationView setImage:pinImage];
customAnnotationView.canShowCallout = YES;
//UIImageView *leftIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ann.png"]];
//customAnnotationView.leftCalloutAccessoryView = leftIconView;
UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside];
customAnnotationView.rightCalloutAccessoryView = rightButton;
return customAnnotationView;
}
Run Code Online (Sandbox Code Playgroud) 我目前的新问题是iphone
我在6个图像视图中显示6个图像它没有在imageview中显示图像我认为图像视图是大尺寸的
我实现这样的代码.
imageview1 = [[UIImageView alloc] init];
UIImage *img1 = [UIImage imageNamed:@"wolf.jpg"];
[imageview2 setImage:img1];
Run Code Online (Sandbox Code Playgroud)
所以PLZ发给我这个imageview的正确代码.
提前谢谢你.
我知道这很可能是一个蹩脚的问题,但是我连续三次全力以赴,而且我非常模糊.我是Objective C和Cocoa Touch的新手.
我创建了一个提供委托方法的类.我将使用简化的示例代码,因为细节并不重要.头文件如下所示:
#import <Foundation/Foundation.h>
@protocol UsernameCheckerDelegate <NSObject>
@required
- (void)didTheRequestedThing:(BOOL)wasSuccessful;
@end
@interface TheDelegateClass : NSObject {
id <TheDelegateClassDelegate> tdcDelegate;
}
@property (assign) id <TheDelegateClassDelegate> tdcDelegate;
- (void)methodThatDoesSomething:(int)theValue;
@end
Run Code Online (Sandbox Code Playgroud)
源文件如下所示:
#import "TheDelegateClass.h"
@implementation TheDelegateClass
@synthesize tdcDelegate;
- (void)methodThatDoesSomething:(int)theValue {
if (theValue > 10) {
[[self tdcDelegate] didTheRequestedThing:NO];
// POINT A
}
// POINT B
int newValue = theValue * 10;
NSString *subject = [NSString stringWithFormat:@"Hey Bob, %i", newValue];
// Some more stuff here, send an email or something, whatever …Run Code Online (Sandbox Code Playgroud) 我会尽量让自己变得清晰.让我们从头开始.我有一个带有tableview的应用程序,其中包含一个距myLocation有距离的地方列表.现在,每当我在gps位置获得更新时,我都会运行以下代码
- (void)locationUpdate:(CLLocation *)location {
myLocation = location;
for (Trek * trek in list) {
CLLocation *loc = [[CLLocation alloc] initWithLatitude:[trek latitude_start] longitude:[trek longitude_start]];
double dis = [locationManager getDistance: loc];
[trek setDistance:dis];
[trek setDistanceUnit];
[loc release];
}
[self.tableView reloadData];
}
Run Code Online (Sandbox Code Playgroud)
现在这段代码[trek setDistanceUnit];调用
-(void) setDistanceUnit {
if (self.distance < 1000.0)
self.distanceString = [NSString stringWithFormat:@"%.0lf m", self.distance];
}
Run Code Online (Sandbox Code Playgroud)
现在,如果我只distanceString使用应用程序崩溃.现在我认为这可能与这些更新可能同时(并行)运行视图绘制单元格所需的访问这一事实有关.任何人有任何想法?我可以发布更多代码,如果有用,我只是不想过多发布这篇文章太久了.
我试着到处寻找,但到目前为止我找不到任何东西.
在此先感谢,翁贝托
PS现在应用程序正在运行,但我想了解发生了什么.
我想使用javascript来检查UIWebView中是否存在类.这是我到目前为止:
NSString* checkForWaldoCmd = [[NSString alloc] initWithString:@"document.getElementsByClassName('waldo');"];
NSString* wheresWaldo = [myUIWebView stringByEvaluatingJavaScriptFromString:checkForWaldoCmd];
Run Code Online (Sandbox Code Playgroud)
我基本上想要检查页面中是否存在"waldo"类.当我运行上面的代码时,无论类是否存在,我都会得到一个空白字符串.有什么建议?
安装xcode ios SDK后,我现在可以运行iPhone模拟器了.现在是否可以安装和运行第三方免费iPhone应用程序,如Paper Glider,就像在真正的iPhone上一样,以及如何做到这一点?
如果您有60个图像使用UIImageView类进行属性animationDuration,则显示动画需要多少时间
请回答这个我无法回应.....
好的答案将从我所有的朋友组中获得至少4张投票谢谢
使用Drupal 6.20.
我们可以设置一些这样的表单元素: -
<input type="select" name="somename[]"><option>ohai</option></select>
Run Code Online (Sandbox Code Playgroud)
然后在PHP中循环使用它们
foreach ($somename as $name) { ... }
Run Code Online (Sandbox Code Playgroud)
我想在Drupal中做同样的事情.我有一个select-elements相同的风格列表.元素的数量可能在将来发生变化,因此表单处理必须是动态的.
如果我使用上述方法,每个元素将覆盖前一个元素,因此最终只有一个元素被打印到屏幕上.我不能写name="somename[$someid]",因为不会解释$somename为数组.
Drupal支持这个还是我做它?
另外,还有其他方法可以达到同样的目的吗?
iphone ×9
objective-c ×4
delegates ×2
ios ×2
annotations ×1
c# ×1
core-data ×1
drupal ×1
drupal-6 ×1
drupal-fapi ×1
ios4 ×1
ipad ×1
javascript ×1
makefile ×1
mapkit ×1
maps ×1
nsarray ×1
speech ×1
uiimage ×1
uiimageview ×1
uitableview ×1