Questions tagged [custom-object]

202 questions
0
votes
0 answers

Persist Set & UIEvent Objects in Swift (Using NSUserDefaults)

When I try to save an UIEvent-Object in NSUserDefaults, the app crashed with an error if i assign a UIEvent object. Why? Is it possible to save an UIEvent with NSUserDefaults? Here is my code: extension UserDefaults { // UIEvent func…
OnurYoruk
  • 1
  • 3
0
votes
1 answer

Custom object with dependencies in CMake

I am contributing a custom feature--say, MyFeature--to a project that uses CMake and has separate source and build directories. MyFeature consists of a single binary file. (MyFeature is in fact a custom Simulink library, so I have to invoke MATLAB…
Amittai Aviram
  • 2,270
  • 3
  • 25
  • 32
0
votes
1 answer

Referencing a custom field id

I have two custom objects, Category and Case, I set category as parent. Column Category_ID in category is referenced by custom object Case. I executed two queries in developer console SELECT Category_ID__c,id, Name FROM Category__c SELECT…
Ben
  • 541
  • 1
  • 5
  • 15
0
votes
1 answer

JUnit test for getter method of custom object type

I need to write unit tests for my methods. I'm having a bit of trouble because I'm new to JUnit. I need to write a test for a getter method of an object type I created. The object type is UnitInfo, and I need to write a test for the method …
l.bol
  • 7
  • 8
0
votes
1 answer

storing custom object with different primitive types in ArrayList

I want to create a custom object with three ints and a String and store that object in an arrayList, but I seem to be having issues with it and haven't been able to find documentation for exactly my issue online. I'm getting errors on the fac.add.…
l.bol
  • 7
  • 8
0
votes
4 answers

The activity is blank something wrong with the custom gird Adapter code?

I'm testing a simple grid adapter with a custom object, the app runs on the device without a problem but stays blank instead of inflating the activity with the specified grid items. This is my code. Main Activity package…
Nobody
  • 397
  • 1
  • 5
  • 25
0
votes
0 answers

NSUserDefaults returns custom objects from array in random manner

When I save array of product (which is a custom object) in NSUserDefaults, and retrieve array from NSUserDefaults, it returns random array. And when I check whether returned array contains added product or not, it always fails. Here is my code:…
0
votes
3 answers

How can I optimize compare function for custom date structure?

I want to sort a vector of dates and I wrote compare function for it: #include struct date { int day; int month; int year; }; int compare_dates(date a, date b) { if (a.year < b.year) { return -1; } else if…
0
votes
3 answers

Best place to store custom objects so all activities can see them

I am an iOS developer who is trying to learn Android and I would like to make sure that I am following best practices. I have custom objects that need to be accessible by 1 -> m activities and they need to be saved when the application closes.…
user1079052
  • 3,803
  • 4
  • 30
  • 55
0
votes
2 answers

How to pass custom object with checked checkbox through intent in adapter to activity

I am displaying hotels in listview with checkbox,image and text. when user click on checkbox then put that checked hotel_id into bundle. And pass to it's super class. When i am selected hotels and click on button on main activity my logcat shows…
0
votes
1 answer

iOS: Custom object's int variable returns nil in NSUserDefaults

I have this weird issue. I'm saving custom class object in NSUserDefaults, and while retrieving the data I get nil for int variable of the object. Below is the custom class class User { var name: String? var user_id: Int? var account_id:…
Srujan Simha
  • 3,637
  • 8
  • 42
  • 59
0
votes
1 answer

Reference specific object in custom object array, and change value

So I have the class Caddy: class Caddy{ var caddyName: String var phoneNumber: Int var email: String var password: String var caddyRank: String var caddyLocation: Int var proPic: UIImage …
user127182
  • 39
  • 1
  • 3
0
votes
1 answer

How can I abort deletion of record on click of delete button?

I am working on Archer. in my application a user opens a record and when user clicks on delete button to delete the record at that stage I need a custom object which gives an alert on clicking delete button and does not allows the user to delete the…
Versug
  • 33
  • 4
0
votes
0 answers

Java Send custom object via socket Client, Server, LAN

I want to send object (custom class) via socket from Client to Server. This is my code: Server: private class SocketServerThread extends Thread { @Override public void run() { try { serverSocket = new…
Magnus2005
  • 97
  • 3
  • 13
0
votes
2 answers

Adding multiple, different controls to DataGridView

I want to make an object that represents a cell in DataGridView, containing a label, combo box, and a text box, and fill the cells in my table with these with different values. I understand how to make a custom cell, but every article or tutorial…