我有一个带导航栏的应用程序,它会推送到登录屏幕视图控制器,然后推送到主菜单.有什么办法可以删除主菜单上的后退按钮,这样用户就无法返回登录界面了?
谢谢!
编辑:使用Xcode 4.3并以编程方式完成所有腿部工作.
有专家帮我吗?在我的Android主要活动中,我正在尝试将String保存到文件中,然后在用户之前设置它时检索它.无法找到任何接近我正在做的事情的例子.我非常感谢任何帮助!这是我崩溃的测试用例:
String testString = "WORKS";
String readString;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
FileOutputStream fos;
try {
fos = openFileOutput("test.txt", Context.MODE_PRIVATE);
fos.write(testString.getBytes());
fos.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
File file = getBaseContext().getFileStreamPath("test.txt");
if (file.exists()) {
FileInputStream fis;
try {
fis = openFileInput("test.txt");
fis.read(readString.getBytes());
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
txtDate.setText(String.valueOf(readString));
} else {
// more code
}
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个@contacts数组正在不同的模型控制器视图上迭代:
<%= @contacts.each do |item| %>
<p>
<%= item.name %>
</p>
<% end %>
Run Code Online (Sandbox Code Playgroud)
这是控制器的样子:
@user = current_user
@contacts = Contact.desc('created_at').where(:user_id => @user.id)
Run Code Online (Sandbox Code Playgroud)
它按预期运行,但使用迭代文本删除此行:
#<Mongoid::Contextual::Mongo:0x007fe0bc0efbd8>
Run Code Online (Sandbox Code Playgroud)
到底他妈发生了什么?