我按照标题为"创建您的第一个应用程序"的说明来设置我的第一个应用程序.但是当我右键单击项目并选择Run As时,我看不到在模拟器上运行的选项!我错过了什么?

我正在尝试使用https://github.com/gekitz/UIDevice-with-UniqueIdentifier-for-iOS-5来生成全局标识符.当我在git中尝试该示例时,它工作正常并正确显示标识符.但是,当我尝试将文件合并到一个新项目时,它不起作用!
我已经包括 -
#import "UIDevice+IdentifierAddition.h"
Run Code Online (Sandbox Code Playgroud)
在我的SampleAppDelegate.m中,复制粘贴项目中的所有文件,并且正在使用
NSString *di = [[UIDevice currentDevice] uniqueGlobalDeviceIdentifier];
Run Code Online (Sandbox Code Playgroud)
在init方法中.我在uniqueGlobalDeviceIdentifier方法的第一行放了一个断点,但它永远不会到达!我错过了什么吗?
编辑:
例外 -
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIDevice uniqueGlobalDeviceIdentifier]: unrecognized selector sent to instance 0x68170c0'
Run Code Online (Sandbox Code Playgroud) 我目前正在我的项目上实现推送通知功能.我设法使用xtify这样做,因为它是与Google的C2DM服务交互的好包装.
现在,正如大多数人可能知道的那样:xtify使用名为xid的标识符进行通信并将通知推送给用户.所以在我的主要活动中(用户打开应用程序时显示的第一个),我有以下代码:
XtifySDK.start(getApplicationContext(), Constants.XTIFY_APP_KEY,
Constants.C2DM_SENDER_ID);
String xid = XtifySDK.getXidKey(getApplicationContext());
if (!"".equals(xid) && xid != null) {
App.setXid(xid);
}
Run Code Online (Sandbox Code Playgroud)
现在我的问题是:
我应该将它存储在数据库中(使用用户信息)吗?并在每次用户连接时检查他/她是否已经有相关的xid,如果没有,请致电
String xid = XtifySDK.getXidKey(getApplicationContext());
生成一个新的? - 有没有办法让Android模拟器获取通知?
先谢谢你们,
android push-notification android-emulator android-c2dm xtify
我正在构建一个应用程序,只需单击一个按钮就可以启动android内置文件系统应用程序.我不知道该怎么称呼它,它将"Documents"作为标题并列出设备上的所有文件.这就是它的样子 - 
如果我的段落高度达到 200 像素,我想显示“阅读更多”链接。使用 Angular 实现这一点的优雅方法是什么?
我的元素——
<section class="mynotes" ng-if="MyController.mynotes">
<p ng-bind="MyController.mynotes" ng-class="{'showMore': more, 'showLess': !more}"></p>
<section ng-click="MyOtherController.togglearrow($event)">
<i class="down-arrow"></i>
<span ng-click="more = !more">{{more ? 'Less' : 'More'}}</span>
</section>
Run Code Online (Sandbox Code Playgroud)
我想根据 p 高度隐藏箭头和“少/多”文本。有任何想法吗?
我正在尝试使用导航抽屉创建一个应用程序.它很有效,直到我尝试在导航抽屉片段中的列表视图上方添加另一个TextView.然后,当我尝试在HomeActivity中设置Concetent时,它会出现此异常:
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
Run Code Online (Sandbox Code Playgroud)
这是所有相关代码:
fragment_navigation_drawer.xml :( 我需要添加fb_name textview.)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/fb_name"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="60dp"
android:text="First Last"
android:textColor="@android:color/white" />
<ListView
android:id="@+id/nav_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:choiceMode="singleChoice"
android:divider="#ffcdcdcd"
android:paddingTop="40dp"
tools:context=".NavigationDrawerFragment" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这是我给片段充气的地方 -
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ViewGroup group = (ViewGroup) inflater.inflate(
R.layout.fragment_navigation_drawer, container, false);
mDrawerListView = (ListView) group.findViewById(R.id.nav_drawer);
mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, …Run Code Online (Sandbox Code Playgroud) 我想知道如何识别标签栏中的项目?
我有一个包含NAvigationController的tabBarController,如下所示:
NSMutableArray *localViewControllersArray = [[NSMutableArray alloc] initWithCapacity:6];
Run Code Online (Sandbox Code Playgroud)
每个navigationController都在这个数组中.
我使用以下方法管理每个标签栏项目中的操作:
- tabBarController:(UITabBarController*)tabBarController didSelectViewController:(UIViewController*)viewController
Run Code Online (Sandbox Code Playgroud)
而我在这种方法中,即:
if (viewController == [self.tabBarController.viewControllers objectAtIndex:0])
Run Code Online (Sandbox Code Playgroud)
像这样我识别我点击的标签栏项目.
但问题是你可以编辑iphone屏幕中的Tabbar(因为数组中有6个viewControllers初始化tabbar)然后,我使用的方式不正确,因为我可以改变viewcontrollers的位置在我使用此编辑工具时在标签栏中.
谢谢
我正在使用以下代码填充我的ListView -
setListAdapter(new NotifListAdapter(this));
Run Code Online (Sandbox Code Playgroud)
我在我的活动的onCreate()方法中调用它,并且在第一次创建时,它填充正常.但是当我返回并返回此活动时,它会在List中显示两倍的行数!我检查了我的数据库,它绝对不是后端问题.此外,当我强制关闭活动并重新启动它时,它会填充正常.有人能提供对这个问题的见解吗?
这是列表适配器 -
public class NotifListAdapter extends BaseAdapter {
public NotifListAdapter(Context context) {
mContext = context;
}
public int getCount() {
return rnList.size();
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
NotifView nv;
RichNotification rn = rnList.get(position);
if (convertView == null) {
nv = new NotifView(mContext, rn.getSubject(),
rn.getContent(), rn.getDate());
} else {
nv = (NotifView) convertView;
nv.setTitle(rn.getSubject());
nv.setDialogue(rn.getContent());
nv.setDate(rn.getDate());
}
return nv;
}
/**
* Remember …Run Code Online (Sandbox Code Playgroud) 我是Objective-C的新手.我有一个枚举如下:
typedef enum _XLBadgeManagedType {
XLInboxManagedMethod = 0,
XLDeveloperManagedMethod = 1
} XLBadgeManagedType ;
Run Code Online (Sandbox Code Playgroud)
我想为它设置getter和setter方法,这样如果发生了什么事,我会设置XLInboxManagedMethod为1.我将如何去做呢?
我试图在点击它时将行设置为粗体.但是当我尝试将视图转换为TextView时,它给出了一个ClassCastException,如下所示 -
setListAdapter(adapter);
final ListView lv = getListView();
lv.setTextFilterEnabled(true);
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
TextView tv = (TextView)view;
tv.setTypeface(null, Typeface.BOLD);
}
});
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?我该怎么办呢?
编辑:
我的适配器看起来像 -
public class CountryListAdapter extends ArrayAdapter<String> {
private final Activity context;
private final ArrayList<String> names;
public CountryListAdapter(Activity context, ArrayList<String> names) {
super(context, R.layout.rowlayout, names);
this.context = context;
this.names = names;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = context.getLayoutInflater(); …Run Code Online (Sandbox Code Playgroud) android ×5
iphone ×3
objective-c ×3
android-c2dm ×1
android-view ×1
angularjs ×1
blackberry ×1
css ×1
enums ×1
file-manager ×1
html ×1
ios ×1
javascript ×1
listview ×1
properties ×1
textview ×1
uuid ×1
xtify ×1