MyViewController有一个UIButton,另一个MainViewController使用MyViewController.
但是MainViewController无法在MyViewController中更改UIButton标题.
另外,在MyViewController中只更改viewDidLoad方法中的UIButton标题.
怎么了?
MyViewController
@interface MyViewcontroller : UIViewController {
IBOutlet UIButton *imageButton;
}
@property (nonatomic, retain) UIButton *imageButton;
@implementation MyViewcontroller : UIViewController {
@synthesize imageButton;
- (void)viewDidLoad { // can change button title
[imageButton setTitle:@"buttonTitle" forState:UIControlStateNormal]
}
- (void)setButtonTitle { // can't change button title
[imageButton setTitle:@"buttonTitle" forState:UIControlStateNormal];
}
}
Run Code Online (Sandbox Code Playgroud)
MainViewController
@implementation MainViewController : UIViewController {
@synthesize scrollView;
- (void)viewDidLoad { // can't change button title
MyViewcontroller *myView = [[MyViewcontroller alloc] initWithNibName:@"MyViewcontroller" bundle:nil];
[myView.imageButton setTitle:@"ddd" forState:UIControlStateNormal];
[scrollView addSubview:myView.view];
[myView …Run Code Online (Sandbox Code Playgroud) Android-Universal-Image-Loader(https://github.com/nostra13/Android-Universal-Image-Loader)是我最喜欢的图书馆.
但是当我使用Android Studio(使用0.1.5版本)时它无法添加库.
我知道如何在Android Studio中添加库(/sf/answers/1163994751/)
当我将Android-Universal-Image-Loader库添加到Android Studio时.关于"无法重新获得R"的编辑错误.我尝试这个Max OSX(我尝试Windows但失败.Windows错误消息=>"Gradle:错误:包com.nostra13.universalimageloader.core不存在".但编辑没有错误消息.仅在我运行应用程序时显示)
像Gson这样的其他libs没问题.但只有Android-Universal-Image-Loader才有这个问题.
您的Android Studio成功添加Android-Universal-Image-Loader?如果成功告诉我如何.
我添加MKPinAnnotationView和setDragAble.我的代码在这里
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
MKPinAnnotationView *annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pin"];
[annotationView setDraggable:YES];
annotationView.pinColor = MKPinAnnotationColorPurple;
return [annotationView autorelease];
}
Run Code Online (Sandbox Code Playgroud)
好的,我可以拖针.
但有一个问题是它不只是一个水龙头.总是需要第二次点击.
当我第一次点击引脚被选中但无法拖动.当我再次点击它的可用拖动.
怎么了?我想只需一个拖动拖动像"Map.app"
文件是这样的
{title:"here", lat:123.4512, lng:36.3423, time:"2011-01-02"}
Run Code Online (Sandbox Code Playgroud)
我想要像这样的chane文档
{title:"here", {latlng: {lat:123.4512, lng:36.3423}}, time:"2011-01-02"}
Run Code Online (Sandbox Code Playgroud)
所以我将通过mongodb控制台尝试这个.
db.coll.find().forEach(function(u){
u.latlng = {"lat":u.lat, "lng":u.lng};
db.coll.save(u);
db.coll.update(u, {$unset:{"map_x1":1, "map_y1":1}});
})
Run Code Online (Sandbox Code Playgroud)
但TT很慢
我认为另一个解决方案
db.coll.find().forEach(function(u){
db.coll.update(u, {{"latlng" : {"lat":u.lat, "lng":u.lng}}, $unset:{"lat":1, "lng":1}});
})
Run Code Online (Sandbox Code Playgroud)
但我无法运行它.因为第一个解决方案仍在运行....
你有这样的快速解决方案吗?
我把我的批处理文件放在lib文件夹中并使用rails db配置,像这样的active-record.
require "#{File.dirname(__FILE__)}/../config/environment.rb"
class Batch
def hello
Message.new do |t|
t.title = "hello"
t.save
end
end
end
batch = Batch.new
batch.hello
Run Code Online (Sandbox Code Playgroud)
当执行批处理时
ruby lib/batch.rb
Run Code Online (Sandbox Code Playgroud)
在开发环境中没关系
但生产环境仍然保存开发数据库......
我如何设置rails_env batch.rb这样
ruby lib/batch.rb RAILS_ENV=production
Run Code Online (Sandbox Code Playgroud) 我想丢弃浮点精度.
(4.43597).discard(3) => 4.435 (not 4.436)
Run Code Online (Sandbox Code Playgroud)
我不想用圆形.我该怎么办?我找不到办法.
我看到了WWDC10会议"104,使用滚动视图设计应用程序".
我想要使用demo获取示例代码.但我找不到它.
我发现"ScrollViewSuite",但它不是同一个演示.
它没有提供?